in reply to Re^3: Lost anonymous subs
in thread Lost anonymous subs
my $code; { my @arr = (9) x 1000_000; $code = sub { @arr }; } # here @arr got out of the scope but is not freed as # there's a ref from inside $code closure # which enables $code do things with the array when called undef $code; # only now that million of nines has gone away # it always existed in exactly one copy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Lost anonymous subs
by diotalevi (Canon) on Dec 09, 2004 at 16:46 UTC | |
by ysth (Canon) on Dec 10, 2004 at 11:41 UTC |