Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^4: $1 not "freezing" in an additionby tobyink (Canon) |
on Dec 14, 2012 at 14:57 UTC ( [id://1008850]=note: print w/replies, xml ) | Need Help?? |
The problem occurs in:
$1 is not a function argument in that. $1 hasn't been a function argument in any of the examples in this thread. The problem is writing an expression where one of the operands has a side-effect that can alter the value of another operand. This is very hard to detect through static analysis of source code; it's probably not especially easy to detect at run-time either. Heuristics may be able to catch some common cases.
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
|
|