Skip to content

Instantly share code, notes, and snippets.

@bbhenry
Created August 10, 2013 01:21
Show Gist options
  • Save bbhenry/6198584 to your computer and use it in GitHub Desktop.
Save bbhenry/6198584 to your computer and use it in GitHub Desktop.
Perl_test_exit_code
system();
if ($? == -1) {
print "failed to execute: $!\n";
} elsif ($? & 127) {
printf "child died - signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
} else {
printf "child exited with value %d\n", $? >> 8;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment