Help for this page

Select Code to Download


  1. 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/; }'
    
  2. 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",
    
  3. or download this
    $! = 0; $line = <$file>; !defined($line) && $! and die "error";