Site Information
Interactive Maps
Site Information
Interactive Maps
Had a situation where we needed to do useful things before dying when opening files, like send SMS text messages to people on call in the dead of night. Here's a possible solution.
eval { open PAPERIN, "<", $sPaperIn or die "Can't open file $sPaperIn: $!"; # "or die" triggers eval }; if ($@) { # do something useful before actually dying, here, # like send an SMS text message. print "We failed to open the file.\n"; print "$@\n"; # display "or die" error contents } else { # do something else very useful, here, # like process the data. print "\nProcessing ::" . $sPaperIn . "::\n"; @aInput = <PAPERIN>; # slup input file close PAPERIN; # [...] }