in reply to Return a value from Perl pgm called by a dos bat file

Here is a sample BAT file that expands on what gellyfish said:
perl -e "exit 5" echo %ERRORLEVEL%
The code above prints "5" , which is what the %ERRORLEVEL% gets set to.

Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarntees offense.