Instead of ```Perl while (my $line = <$fh>) { doSomethingWithLine($line); } ``` the following paradigm should be used ```Perl while (!eof($fh)) { my $line = readline($fh); if (! defined $line) { die "IO Error: $!" } doSomethingWithLine($line); } ``` This correctly recognizes and handles IO errors during the processing (in contrast to the previous simple method).