Do you know where your variables are? | |
PerlMonks |
Re^7: perl inheritanceby tobyink (Canon) |
on Mar 24, 2012 at 13:12 UTC ( [id://961398]=note: print w/replies, xml ) | Need Help?? |
Very little advantage in this case. It just so happens that in the same loop I'm also playing around with @ISA and past experience has taught me to alter @ISA as early as possible. Modern versions of Perl are pretty smart when it comes to invalidating method resolution caches, but force of habit makes me put any @ISA alteration in a BEGIN block unless there's a good reason not to.
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
|
|