Personally if I don't close a file it does not feel right - a bit like walking out the door without my trousers on.Yeah, but you still didn't flush.
Why do feel dirty if you don't close the file yourself (instead of having Perl do it for you), but you're fine with Perl doing the flushing (and syncing) for you? And do you close STDOUT and STDERR?
I close my handles when I want to inform the user of a possible error - else I let Perl (or the OS) take care of it for me.
In reply to Re^2: Why do we need to close filehandles?
by JavaFan
in thread Why do we need to close filehandles?
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |