Everything I've seen says that destruction in Perl is timely. Destruction occurs as soon as the value's ref count reaches zero. Do you have any documentation to contradict that?
This is in contrast with Java, where garbage collection is not as predictable.
Update: The only documentation bit I've found is in perlref:
Hard references are smart--they keep track of reference counts for you, automatically freeing the thing referred to when its reference count goes to zero.
And it goes on to say
If that thing happens to be an object, the object is destructed.
There's no mention of a delay or of it being deferred. Although it doesn't say explicitly say "immediately", I'm still convinced it is because my belief is based on much more than that one statement.
In reply to Re^4: Implicit closing of files
by ikegami
in thread Implicit closing of files
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |