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

RE: why doesn't this error

Thread Previous | Thread Next
Bob Showalter
February 1, 2002 08:31
RE: why doesn't this error
Message ID:
> -----Original Message-----
> From: Alex Harris []
> Sent: Friday, February 01, 2002 11:06 AM
> To:
> Subject: why doesn't this error
> First, I read perldoc -f exec() and did as follows:
> exec "rsh $plant /u1/bin/forkit ''" or
>        print STDERR "Couldn't fork it.\n $!\n";
> BUT, even though the file it should be exec - ing '' 
> does NOT exist 
> on the remote system, the error doesn't get kicked off.  The 
> only error I've 
> gotten it to register is if $plant is invalid.  Any ideas?

The exec will only fail if rsh doesn't exist. Assuming rsh
exists, rsh *completely replaces* your perl script. Any problems
encountered by rsh will be apparent only after your perl script is

You need to use system() instead of exec() if you need to determine
whether rsh had any problems.

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