in reply to Filehandles question
1. You don't have to worry about leaking filehandles. The operating system will free resources used by the process. This is true for any OS I can think of that perl runs on.
2. You may be bitten by bufferring, because your output is not flushed to the file before the script ends.
3. On non-regular files, the close system call can fail. If you don't close the file yourself, you get no indication of this.
It's generally considered good practice to close the files, even if none of the above gives you particular reason to worry. (It sounds like #2 might, though.) Some reading: "Suffering from Buffering?", Catching errors in closing lexical filehandles.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Filehandles question
by thor (Priest) on Dec 10, 2004 at 12:40 UTC |