rem ... perl -x -S %0 if errorlevel 1 goto fail goto end rem -- command shell will never try to interpret this or the following lines up to the fail label. #!perl use strict; use warnings; use lib 'lib'; use My::Custom::Setup; My::Custom::Setup->run(); __END__ rem ^-- perl stops interpreting at __END__ :fail pause end