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

RE: still not catching error

Thread Previous
From:
Bob Showalter
Date:
February 2, 2002 06:32
Subject:
RE: still not catching error
Message ID:
2E4528861499D41199D200A0C9B15BC031B7E7@FRISTX
> -----Original Message-----
> From: Roger C Haslock [mailto:roger@haslock.com]
> Sent: Saturday, February 02, 2002 5:43 AM
> To: Bob Showalter; 'Alex Harris'; beginners@perl.org
> 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About