- or download this
system('some_shell_command') >> 8 and die "Failed!";
...
if ($? >> 8 != 0) {
die "Failed!";
}
- or download this
system('foobar') == 0 or die "Failed!";
...
if ($? != 0) {
die "Failed!";
}
- or download this
if ($? == -1) {
print "failed to execute: $!\n";
...
else {
printf "child exited with value %d\n", $? >> 8;
}