in reply to Re: Why do we need to close filehandles?
in thread Why do we need to close filehandles?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why do we need to close filehandles?
by Anonymous Monk on May 01, 2011 at 20:56 UTC |