in reply to can PERL just quit?

Since you are not testing the return values of open or anything else, I would definitely have use autodie; in place.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^2: can PERL just quit?
by gupr1980 (Acolyte) on Jun 09, 2014 at 21:33 UTC
    i get Can't locate autodie.pm on Linux. How can i get this? I have autodie.pm on my windows workstation, is there a way i can copy it over to Linux server?
      Hmm, surprising... The autodie module has been a standard Perl package for quite a while. Which version of Perl are you running?
        v5.8.8

      You can get it from metaCPAN: autodie

      I would normally say get it from CPAN, but they have been down a lot lately. :(

      You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

        For clarity, CPAN has not been down. http://search.cpan.org has been unavailable for various reasons recently.

        Hi :) you confused search.CPAN.org with CPAN :) cpan autodie
      You don't need autodie. You can rewrite your code so that it checks for errors and reports the reason for failure, e.g.:
      open my $INFILE, '<', $infilename or die "Cannot open $infilename: $!" +; seek $INFILE, $readoffset, 0 or die "Cannot seek: $!"; open my $OUTFILE, '>>', $outfilename or die "Cannot open $outfilename: + $!";