|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re^3: How to have OS specific code sections in Perlby tobyink (Prior) |
| on Oct 31, 2012 at 18:44 UTC ( #1001728=note: print w/ replies, xml ) | Need Help?? |
|
The problem is that the conditional block is only evaluated at run time, by which time it's too late for use if. You want:
Or better:
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
|
|
||||||||||||||||||||