in reply to perl and windows batch
Given error.bat:
c:\test>type error.bat @echo off exit /b 123
Use:
system 'error.bat & exit ERRORLEVEL';; print $? >>8;; 123
Note: Because Perl attempts to emulate *nix here, exit codes (ERRORLEVELs) are truncated to 8 bits.
Or, skip using /b:
c:\test>type error.bat @echo off exit 123 c:\test>p1 [0] Perl> system 'error.bat'; print $? >>8;; 123
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl and windows batch
by leonidlm (Pilgrim) on Jul 31, 2008 at 11:54 UTC |