-----Original Message-----
From: Shourya Sengupta [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 03, 2006 2:15 PM
To: beginners@perl.org
Subject: perl script calls batch file


Hi,
My perl program calls a batch file on a remote machine.
Now my question is how to return a value from that batch script and how
to grab it in the perl file?


***INFOSYS******** End of Disclaimer ********INFOSYS***

In shell use the $? variable.  This holds the return code of that last
command or script.  

At the end of your script have something like...
echo $? > /tmp/rc.out;


0=true
1=false 
In shell

Then in your Perl program
Check to see if the file is > 0
If it is open the file and do your magic. 

_________________________________________________

This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information. If you have received it in 
error, please notify the sender immediately and delete the original. Any other 
use of the email by you is prohibited.

Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk 
- Portuguese - Svenska: www.cardinalhealth.com/legal/email

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to