Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    use warnings;
    ...
    Uncaught exception from user code:
      Can't open '/tmp/foo/' for reading: 'No such file or directory' at -
    + line 6
      main::__ANON__("FOO", "<", "/tmp/foo/") called at - line 6
    
  2. or download this
    {
      no autodie qw(open);          # open failures won't die
      open(my $fh, "<", $filename); # Could fail silently!
      # ^^^ add your "or die" to this open
    }