Help for this page
$! = 0; $line = <$file>; ... { print "reached eof\n"; } else { $line=~/(.*)/; print qq(read a line: "$1"); }
echo $'three\nshort\nlines' > a; perl -we 'open $f, "<", "a"; for(0..3) { $!=10000; $l = <$f>; $s = $! +; warn +(defined($l)?$l=~/(.*)/&&qq/"$1"/:"undef"), " $s\n"; }'
"three" Bad file descriptor "short" Unknown error 10000 "lines" Unknown error 10000 undef undef