David Nicol <[EMAIL PROTECTED]> writes: > On 13 May 2005 03:11:36 -0700, Gisle Aas <[EMAIL PROTECTED]> wrote: > > Another way to fix this to to make $? be exactly those 16 bits > > described by this code segment found in description of system in > > perlfunc: > > > > | You can check all the failure possibilities by inspecting > > | C<$?> like this: > > | > > | if ($? == -1) { > > | print "failed to execute: $!\n"; > > | } > > | elsif ($? & 127) { > > | printf "child died with signal %d, %s coredump\n", > > | ($? & 127), ($? & 128) ? 'with' : 'without'; > > | } > > | else { > > | printf "child exited with value %d\n", $? >> 8; > > | } > > this code identifies the low seven bits as the signal, the > eigth bit as the coredump flag, and divides by 256 to get > the exit value. It does not assert in any way that the > exit value is limited to eight bits.
True. You need to start out with the context that $? is a 16 bit value in the first place and perlvar.pod does state that this is the case. > Does AIX 5 have 32-bit shorts? I have no idea. Does it matter? Regards, Gisle