-
-
22 Jul 2015 19:33:50 UTC
- Distribution: B-Utils
- Module version: 0.27
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (6)
- Testers (9643 / 149 / 6)
- Kwalitee
Bus factor: 1- 53.97% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (72.86KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
B::Utils::OP - op related utility functions for perl
VERSION
version 0.27
SYNOPSIS
use B::Utils::OP qw(parent_op return_op); sub foo { my $pop = parent_op(0); my $rop = return_op(0); }
DESCRIPTION
sub foo { dothis(1); find_things(); return; }
has the following optree:
d <1> leavesub[1 ref] K/REFC,1 ->(end) - <@> lineseq KP ->d 1 <;> nextstate(main -371 bah.pl:8) v/2 ->2 5 <1> entersub[t2] vKS/TARG,3 ->6 - <1> ex-list K ->5 2 <0> pushmark s ->3 3 <$> const[IV 1] sM ->4 - <1> ex-rv2cv sK/3 ->- 4 <#> gv[*dothis] s ->5 6 <;> nextstate(main -371 bah.pl:9) v/2 ->7 9 <1> entersub[t4] vKS/TARG,3 ->a - <1> ex-list K ->9 7 <0> pushmark s ->8 - <1> ex-rv2cv sK/3 ->- 8 <#> gv[*find_things] s/EARLYCV ->9 a <;> nextstate(main -371 bah.pl:10) v/2 ->b c <@> return K ->d b <0> pushmark s ->c
The
find_things
infoo
is called in theentersub
in #9. If you callparent_op
function with level 0, you get thenextstate
op that is before the entersub, which is #6. Andreturn_op
gives you the next op that the caller is returning to, in this case, thenextstate
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
AUTHORS
Chia-liang Kao <clkao@clkao.org>
COPYRIGHT
Copyright 2008 by Chia-liang Kao
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install B::Utils, copy and paste the appropriate command in to your terminal.
cpanm B::Utils
perl -MCPAN -e shell install B::Utils
For more information on module installation, please visit the detailed CPAN module installation guide.