|
|
| "be consistent" | |
| PerlMonks |
Re^6: How to call a sub-routine refby tobyink (Monsignor) |
| on Oct 22, 2012 at 15:34 UTC ( #1000367=note: print w/ replies, xml ) | Need Help?? |
|
That makes it sound like the left side is only unshifted onto the parameter list in the third cases, but actually it's unshifted in all three cases. Also, I'd cut out the talk of classes and just say it needs to be a package name. For example, File::Spec is not a class in the normal sense of the word, but it's a package name that can appear on the left side of the arrow. Here's my attempt at explaining ->...
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
|
|
||||||||||||||||||||