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

RE: why doesn't this error

Thread Previous | Thread Next
From:
Bob Showalter
Date:
February 1, 2002 08:31
Subject:
RE: why doesn't this error
Message ID:
2E4528861499D41199D200A0C9B15BC031B7DF@FRISTX
> -----Original Message-----
> From: Alex Harris [mailto:atkharris@hotmail.com]
> Sent: Friday, February 01, 2002 11:06 AM
> To: beginners@perl.org
> Subject: why doesn't this error
> 
> 
> First, I read perldoc -f exec() and did as follows:
> 
> exec "rsh $plant /u1/bin/forkit 'work.pl'" or
>        print STDERR "Couldn't fork it.\n $!\n";
> 
> BUT, even though the file it should be exec - ing 'work.pl' 
> 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
gone.

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

Thread Previous | Thread Next


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