If you want to know why the command exited with an error, you could examine the value of $? like this:system('whatever'); if ($?) { warn "whatever failed\n"; }
(See perlvar and system for more about $?)system('whatever'); if ($?) { my $exit_value = $? >> 8; my $signal_num = $? & 127; my $dumped_core = $? & 128; print "whatever exited with status $exit_value"; print " from signal $signal_num" if $signal_num; print " and dumped core" if $dumped_core; print "\n"; }
In reply to Re: exit status
by chipmunk
in thread exit status
by ginju
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |