in reply to Re: perl and windows batch
in thread perl and windows batch

exit /b 123 is identical to exit 123 when executed at the command line level.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: perl and windows batch
by Anonymous Monk on Jan 08, 2013 at 18:30 UTC
    Actually, I found that when I used exit /b in the batch file, I was not getting the return code in my perl. Once I stripped the /b I did.

      Executed from within a batch file, /b sets the %errorlevel% environment variable and exits the batch file, rather than exit cmd.exe and return the value as it process exit code.

      Outside a batch file, (ie. on the command line), /b is a non-op.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.