is very much a closure, because $x is lexically scoped to that block, and sub foo is by definition global and survives the loop, $x goes away, except for the one reference in sub foo. his second one, however, would not be a closure.{ my $x; sub foo { return ++$x; } }
- Ant
In reply to Re: (tye)Re: Unusual Closure Behaviour
by suaveant
in thread Unusual Closure Behaviour
by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |