package Pexitstat; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(exitstatus); my $EAGAIN; if (eval "use POSIX; 1" && ($EAGAIN = POSIX::constant("EAGAIN", 0)) && defined(POSIX::constant("WEXITSTATUS", 0)) && $! == $EAGAIN) { *exitstatus = sub { POSIX::constant("WEXITSTATUS", $_[0]) }; } else { *exitstatus = sub { $_[0] >> 8} } 1;