Hi I think this clarifies the situation. $x is definitely lexically scoped. Run this as in then uncomment the use strict.
cheers# use strict; sub foo { my $x if 0; return ++$x; } for (1..7){ print foo(); print "($x)"; };
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Re: Unusual Closure Behaviour
by tachyon
in thread Unusual Closure Behaviour
by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |