That's a safety feature, but it's better to close files when you're done with them:
Open file handles shouldn't be treated like other variables in terms of garbage collection. The memory may be returned to the operating system when it exists, but Perl has no way of knowing for sure if it should be unlocked or the buffer flushed.... (there may be times where doing so can do more harm than good), so it won't do these things.
If you don't want to be bothered with file opening and closing semantics, then use something like IO::All.
In reply to Re^2: Filehandles question
by rrwo
in thread Filehandles question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |