When I write open(my $fh, .....) or die ...., the very next line of code I write is close($fh) die "Close error on file xxxx -- $!"; then I go back and fill-in the stuff between the open() and close().
This (usually) makes my close() in the same scope as my open(), so I don't go littering open file-handles; or worse, reusing a file-handle unintentionally. Now, I know that Perl will close files when they go out of scope, I just prefer the tidiness aspect of doing it myself. And, there have been times when the name of my temporary file was significant to the process; knowing which TempFile had the problem made restart much cleaner.
----
I Go Back to Sleep, Now.
OGB
In reply to Re: module which tells more warning about FILHANDLE
by Old_Gray_Bear
in thread module which tells more warning about FILHANDLE
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |