package My::QXcall; use strict; use vars qw( $VERSION @ISA @EXPORT ); use Exporter; @ISA = qw( Exporter My ); $VERSION = 0.00_1; # Wed Jun 11 17:14:17 CDT 2003 @EXPORT = qw( QXcall QXstatus QXsignal QXerror QXoserror QXerrline ); our($STAT, $SIG, $ERR, $OSERR, $LINE); sub QXcall { undef($STAT); undef($SIG); undef($ERR); undef($OSERR); undef($LINE); my($call,$errmsg) = @_; my(@call) = `$call`; $STAT = $? >> 8; $SIG = $SIG{ $? & 127 } || $? & 127; if ($STAT) { $OSERR = $^E; $LINE = (caller)[2]||'?'; $ERR = $errmsg ? $errmsg . NL : '' . join("\n",@call) . qq[syscall failed with status $STAT, signal $SIG] . "\n"; } @call } sub QXstatus { $STAT } sub QXsignal { $SIG } sub QXerror { $ERR } sub QXoserror { $OSERR } sub QXerrline { $LINE } 1;