develooper Front page | perl.beginners | Postings from February 2002

RE: still not catching error

Thread Previous
Bob Showalter
February 2, 2002 06:32
RE: still not catching error
Message ID:
> -----Original Message-----
> From: Roger C Haslock []
> Sent: Saturday, February 02, 2002 5:43 AM
> To: Bob Showalter; 'Alex Harris';
> Subject: Re: still not catching error
> You are testing the exit status of the system call, not the 
> exit status of
> the rsh call which is in $?.
> You need
> $systemstatus=system(...);
> $rshstatus=$?;

From the docs for system():

   ...The return value is the exit status of the program
   as returned by the "wait" call.  To get the actual
   exit value divide by 256.

So he *is* testing the rsh exit status (at least 0 vs non-zero). 
The problem is that rsh does not return the exit status of the 
command it is running, which is what the OP is trying to check. 
$? will not help him with that.

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About