The return code in this case will signify whether the batch script could
be successfully called from the perl file or not.
It will not contain the value specifically returned from the batch
script.

-----Original Message-----
From: Smith, Derek [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 03, 2006 11:56 PM
To: Shourya Sengupta; beginners@perl.org
Subject: RE: perl script calls batch file


-----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

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

--
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