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
In reply to Re: perl and windows batch
by BrowserUk
in thread perl and windows batch
by leonidlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |