in reply to Implicit closing of files
Back to the question at hand, from my readings of local (when I was doing some investigation of globals and such) was that outside of the scope they were invisible and unalterable, but have never seen anything that specifically mentions whether or not they are "garbage collected". I would imagine so, but being a local I can't also see why you would encounter issues with the variable in other parts of the program.
For Windows scripts, the ones I use run on *nix and Windows platforms, I have never encountered problems with the buffer, but I usually place a close(HANDLE) within the script just to be clean.
Though I would be curious as well if Perl does internally destruct local variables when they go out of scope, of if they hang around and are only flushed upon exit.
|