> [abigail@arenanetworks.com - Tue May 30 09:25:02 2000]: > > This is a bug report for perl from abigail@arena-i.com, > generated with the help of perlbug 1.28 running under perl v5.6.0. > > > ----------------------------------------------------------------- > [Please enter your report here] > > This might be related to my previous report. > > Consider the following program: > > #!/opt/perl/bin/perl -w > > use strict; > > sub new { > my ($class, $code) = @_; > bless $code => $class; > } > > DESTROY { > print "In DESTROY...\n"; > } > > my $i = "Hello"; > my $exit = main -> new (sub {}); # 1) > > __END__ > > This will not print anything at all, indicating that the DESTROY > method > isn't called when $exit goes out of scope - not even on program > termination. > > If we change 1) such that new() is called with a closure, for instance > by changing it to: > > my $exit = main -> new (sub {$i}); # 1) > > DESTROY is called as soon as $exit goes out of scope. > > This problem still exists in bleadperl.Thread Next