"be consistent" | |
PerlMonks |
Re: Re: Unusual Closure Behaviourby HyperZonk (Friar) |
on Jul 12, 2001 at 22:19 UTC ( [id://96136]=note: print w/replies, xml ) | Need Help?? |
Actually, the if being evaluated first is
exactly what we would want in any case. You are missing the
implication of the behavior, however. The variable, besides
being localized which is unexpected (until one realizes that
data scoping is done at compile-time in this case), also
becomes static; that is, it retains its value between calls,
which is unexpected behavior for a local via my
variable. See iakobski's reply in this thread
for more details.
In Section
Seekers of Perl Wisdom
|
|