in reply to perl and windows batch
my $output = `batch_file args`; die "Gone horribly wrong - $?" if $?; # or ... my @output = `batch_file args`; die "Gone horribly wrong - $?" if $?;
.oO(Unless, of course, Windoze sees fit to not return the status code from the batch script, in which case...)
my $output = `batch_file args && exit /b ERRORLEVEL`; die "Gone horribly wrong - $?" if $?; # or ... my @output = `batch_file args && exit /b ERRORLEVEL`; die "Gone horribly wrong - $?" if $?;
,or something similar, may suffice ... unless I'm missing something obvious?!
Sits back and awaits flames, errm, constructive observations ;-)
HTH ,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl and windows batch
by BrowserUk (Patriarch) on Jul 31, 2008 at 13:06 UTC | |
by Anonymous Monk on Jan 08, 2013 at 18:30 UTC | |
by BrowserUk (Patriarch) on Jan 08, 2013 at 18:42 UTC |