laziness, impatience, and hubris | |
PerlMonks |
When <> failsby Dinosaur (Beadle) |
on Jul 29, 2008 at 19:20 UTC ( [id://700900]=perlquestion: print w/replies, xml ) | Need Help?? |
Dinosaur has asked for the wisdom of the Perl Monks concerning the following question:
A script which has been generally well behaved failed silently recently when nfs jerked the rug out from under its input file, which it had been reading with "while(<>)". Apparently <> just returned null when the error occurred, and the loop terminated gracefully.
Opening a filehandle and checking the return from close would get me around this problem. But the management of input files provided by <> is very convenient. Is there any way to check the success of <>? Thanks, Dinosaur
Back to
Seekers of Perl Wisdom
|
|