Your best bet here might be to use the %ERRORLEVEL% variable in your
batch script and then print it to the screen with an easily identifiable
tag (E.g. 'ERRORLEVEL=x'). Your perl script can just look for your
status messages and pull them out with a regex:
my $result;
foreach my $output( @batch_output ){
if( $output =~ /^ERRORLEVEL=(\d+)$/ ){
$result = $1;
do something...
}
}
-----Original Message-----
From: Shourya Sengupta [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 03, 2006 11:15 AM
To: [email protected]
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?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>