B::Utils::OP3pm
Op related utility functions for perl
Usage
use B::Utils::OP qw(parent_op return_op);sub foo {my $pop = parent_op(0);my $rop = return_op(0);}
Version
version 0.27
Overview
sub foo {dothis(1);find_things();return;}
has the following optree:
d <1> leavesub[1 ref] K/REFC,1 ->(end)- <@> lineseq KP ->d1 <;> nextstate(main -371 bah.pl:8) v/2 ->25 <1> entersub[t2] vKS/TARG,3 ->6- <1> ex-list K ->52 <0> pushmark s ->33 <$> const[IV 1] sM ->4- <1> ex-rv2cv sK/3 ->-4 <#> gv[*dothis] s ->56 <;> nextstate(main -371 bah.pl:9) v/2 ->79 <1> entersub[t4] vKS/TARG,3 ->a- <1> ex-list K ->97 <0> pushmark s ->8- <1> ex-rv2cv sK/3 ->-8 <#> gv[*find_things] s/EARLYCV ->9a <;> nextstate(main -371 bah.pl:10) v/2 ->bc <@> return K ->db <0> pushmark s ->c
The "find_things" in "foo" is called in the "entersub" in #9. If you call "parent_op" function with level 0, you get the "nextstate" op that is before the entersub, which is #6. And "return_op" gives you the next op that the caller is returning to, in this case, the "nextstate" in #a.
Exported perl functions
- parent_op($lv)
-
In runtime, returns the B::OP object whose next is the
"entersub"of the current context up level$lv
- return_op($lv)
-
In runtime, returns the B::OP object that the current context is returning to at level
$lv
B::CV methods
- $cv->NEW_with_start($root, $start)
-
Clone the
$cvbut with different$rootand$start
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 7 times.