http://www.perlmonks.org?node_id=989615


in reply to getting the bash exit code

$?
This is just the 16-bit status word returned by the traditional Unix "wait()" system call (or else is made up to look like it). Thus, the exit value of the subprocess is really ("$? >> 8")
Sorry if my advice was wrong.