Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: can't use string refs while "strict refs"by tobyink (Canon) |
on Jul 30, 2012 at 07:16 UTC ( [id://984373]=note: print w/replies, xml ) | Need Help?? |
Perhaps something like this:
Note the trick is to capture the return value of the =~ into an array (which I've called @matches above). Trick number two is to unshift a dummy value into $matches[0]. This is because arrays are indexed from 0 and regex matches are numbered from 1. Unshifting the dummy value makes @matches line up better with $- and $+.
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
|
|