- or download this
eval {
system("perl 2.pl");
...
print "the error that was thrown in 2.pl";
}
...
- or download this
system("blah") or die "Can't blah $!\n";
- or download this
my $ret_val = system("perl 2.pl");
if ( $ret_val == 0 ) {
...
else {
printf "Error. Err Number: %d", $ret_val<<8;
}
- or download this
exit 0 if $success;
exit $err_num if $err_num; # numerical error value
exit -1; # WTF???
- or download this
open F, $file or do {
warn "Can't open $file for read $!\n";
...
do_stuff(*F);
close F;
exit 0;