- or download this
perl -we 'open $f, "<", "/etc/passwd" or die 1; for (0..2) { $! = 0; $
+l = readline $f; $s = $!; chomp $l; print qq/"$l", $s\n/; }'
- or download this
"root:x:0:0:root:/root:/bin/bash", Bad file descriptor
"bin:x:1:1:bin:/bin:/bin/false",
"daemon:x:2:2:daemon:/sbin:/bin/false",
- or download this
$! = 0; $line = <$file>; !defined($line) && $! and die "error";