note
pc88mxer
Technically to only test the status code you should use:
<c>
if ($? >> 8) { print "Error " }
</c>
The lower eight bits of <c>$?</c> contain the signal that terminated the process.
<p>There's more info in the <c>perldoc POSIX</c> documentation. In particular, see the documentation for the functions <c>WEXITSTATUS</c> and <c>WIFEXITED</c>.
<p>Note that you shouldn't always trust the status code since it is possible for the command to terminate (like via a signal) before it has a chance to set it.
700639
700639