in reply to Re: Re: Garbage-collecting with closures
in thread Garbage-collecting with closures

Sorry, my mistake. They have to be nested anonymous subs, like this:
my $foo = 'asdf' x 1000; for (1..900000) { my $outer_sub = sub { my $inner_sub = sub { $foo }; } }

Replies are listed 'Best First'.
Re: Re: Re: Re: Garbage-collecting with closures
by Courage (Parson) on Feb 20, 2003 at 19:35 UTC
    You're right.

    I think this code should be fed to 'perlbug' utility.

    Although I seem to remember it was discussed in p5p list somehow, such closure leaks were almost went away just before 5.6.0, but they were too evil to fix.

    Courage, the Cowardly Dog