B::OPCheck - PL_check hacks using Perl callbacks
use B::Generate; # to change things use B::OPCheck entersub => check => sub { my $op = shift; # op has been checked by normal PL_check sodomize($op); }; foo(); # this entersub will have the callback triggered
PL_check is an array indexed by opcode number (op_type) that contains function pointers invoked as the last stage of optree compilation, per op.
This hook is called in bottom up order, as the code is parsed and the optree is prepared.
This is how modules like autobox do their magic
This module provides an api for registering PL_check hooks lexically, allowing you to alter the behavior of certain ops using B::Generate from perl space.
Called after normal PL_checking. The return value is ignored.
Not yet implemented.
Allows you to return a processed B::OP. The op has been processed by PL_check already.
Allows you to return a processed B::OP to be passed to normal PL_check.
Allows you to return a processed B::OP yourself, skipping normal PL_check handling completely.
Chia-liang Kao <clkao@clkao.org> Yuval Kogman <nothingmuch@woobling.org>
Copyright 2008 by Chia-liang Kao, Yuval Kogman
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install B::OPCheck, copy and paste the appropriate command in to your terminal.
cpanm
cpanm B::OPCheck
CPAN shell
perl -MCPAN -e shell install B::OPCheck
For more information on module installation, please visit the detailed CPAN module installation guide.