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

RE: still not catching error

Thread Previous | Thread Next
From:
John Edwards
Date:
February 1, 2002 08:58
Subject:
RE: still not catching error
Message ID:
2FB59B145095D511A7C90050BAC349F3173175@MAIL
Try

$result = `rsh $plant /u1/bin/forkit '/u1/bin/work.pl'`;

print $result;

You are storing the output of the rsh... command into the variable. You can
now run a regex on that to check for success/failure.

I don't know what the output should be but as an example...

$result = `rsh $plant /u1/bin/forkit '/u1/bin/work.pl'`;

if ($result =~ /worked/i) {
	print "Yep, that worked\n";
} else {
	print "Ooops. Something went wrong: $result";
}

HTH

John

-----Original Message-----
From: Alex Harris [mailto:atkharris@hotmail.com]
Sent: 01 February 2002 16:52
To: beginners@perl.org
Subject: still not catching error


I took out the exec and placed system.  But even though work.pl doesn't 
exist on the remote system, still getting no error.  Help!

if (system("rsh $plant /u1/bin/forkit '/u1/bin/work.pl'") > 0)
      {
        excep(" $!\n");
      }

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



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