in reply to Re^3: Implicit closing of files
in thread Implicit closing of files
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Implicit closing of files
by dragonchild (Archbishop) on Jun 17, 2008 at 13:20 UTC | |
by ikegami (Patriarch) on Jun 17, 2008 at 13:44 UTC | |
by chromatic (Archbishop) on Jun 17, 2008 at 18:36 UTC |