in reply to Pattern for a shell-style call + error response

If it really conforms to POSIX exit codes, then you need much more complex handling than just inverting with "not", e.g.
CheckExitCode( $item -> frobinize(...)) or die($libobj->GetErrorCode); sub CheckExitCode { if ($_[0] == -1) { print STDERR "POSIX: failed to execute\n"; return 0; } elsif ($_[0] & 127) { printf STDERR "POSIX: child died with signal %d, %s coredump\n", ($_[0] & 127), ($_[0] & 128) ? 'with' : 'without'; return 0; } elsif ( !$_[0] ) { printf STDERR "POSIX: child exited with value %d\n", $_[0] >> 8; return 0; } 1; }
__________________________________________________________________________________

^M Free your mind!