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


in reply to how do I extract status from the response of waitpid ?

The exit code is '$? >> 8', not the returned value. $? is documented in perlvar man page.

Replies are listed 'Best First'.
Re^2: how do I extract status from the response of waitpid ?
by ikegami (Patriarch) on Aug 14, 2015 at 12:17 UTC
    $? >> 8 is only meaningful if waitpid returned a value greater than zero and if $? != -1 && ($? & 0x7F) == 0.