in reply to Re^5: Implicit closing of files
in thread Implicit closing of files
Calling of DESTROY is neither timely nor ordered.
You're thinking of global destruction. Scope-exiting destruction in Perl 5 is indeed timely and deterministic (though you probably shouldn't rely on the order of destruction of $foo, $bar, and $baz in the following example):
{ my $foo = 1; my $bar = 2; my $baz = 3; }
Localized restoration uses the same reference-counting mechanism, so the appropriate destruction there is timely.
|
|---|