Perl: the Markov chain saw | |
PerlMonks |
Re: effects of ampersand and non ampersand when referencing a sub nameby tobyink (Canon) |
on Dec 20, 2012 at 08:56 UTC ( [id://1009707]=note: print w/replies, xml ) | Need Help?? |
Using a coderef at all bypasses prototypes. (As does calling a sub as a method.) If you need to check the number of arguments passed to a sub, do it in the sub! Prototypes are just to help the Perl parser parse argument lists more sanely.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|