I can answer this with much zeal and vigor. (Or I just wanted to use those two words.)
Use the B::Terse module, I made the following check:
jeffp@friday [10:44am] parsers #264> perl -MO=Terse
sub a { print 1 }
sub b { print 2 }
$c = a() + b();
- syntax OK
LISTOP (0x13b940) pp_leave
OP (0x130ef8) pp_enter
COP (0x13b970) pp_nextstate
BINOP (0x142ce0) pp_sassign
BINOP (0x142d00) pp_add [3]
UNOP (0x142c20) pp_entersub [1]
UNOP (0x13b9d0) pp_null [141]
OP (0x130f58) pp_pushmark
UNOP (0x142c40) pp_null [17]
GVOP (0x142c60) pp_gv GV (0x12dbac) *a
UNOP (0x142d20) pp_entersub [2]
UNOP (0x13ba90) pp_null [141]
OP (0x130f70) pp_pushmark
UNOP (0x142d40) pp_null [17]
GVOP (0x142d60) pp_gv GV (0x14bbc4) *b
UNOP (0x12ea00) pp_null [15]
GVOP (0xbed00) pp_gvsv GV (0xc6304) *c
Yes, Perl will call a() before it calls b(). That's why you can safely say: ($a,$b) = (shift, shift) to get the first two values from @_, IN THE RIGHT ORDER. (But you'd use splice(), really.)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.