Help for this page

Select Code to Download


  1. or download this
     unless (defined( $line = <> )) {
          die $! if $!;      # $! is only current and valid in the afterma
    +th of a failure
          last; # reached EOF
     }
    
  2. or download this
    $line = <>;
    if ($!) {
      print "Ohh noo, $!";  # an indefinite false-positive
    }
    
  3. or download this
    $ touch test;  # create the dummy
    
    ...
    $perl -Mstrict -Wle 'undef $!; open my $fh, "<", "test" or warn "warn 
    +: $!"; print "after : $!"
    warn : No such file or directory at -e line 1.
    after : No such file or directory