That will create a new copy of $foo every time and it will not get cleaned up. I don't know if 5.8 did anything to address this or not.my $foo; sub leaky { my $closure = sub { $foo++ }; }
In reply to Re: Garbage-collecting with closures
by perrin
in thread Garbage-collecting with closures
by batkins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |