Open
Description
Instead of
while (my $line = <$fh>) {
doSomethingWithLine($line);
}
the following paradigm should be used
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).
Metadata
Metadata
Assignees
Labels
No labels