For example perl C:\Projects\trunk\PcApps\BaseCamp\Test\smoketest.pl C:\Projects\trunk\PcApps\BaseCamp\Test\log.txt
Without the perl
.
Assign the .pl extension to the perl interpreter. It depends on your Windows version how you do that.
Depending on the perl installer you are using it might also provide you with an option to do so automatically.
You can put this at the top of your perl script's file:
@SETLOCAL ENABLEEXTENSIONS
@c:\strawberry-perl-port\perl\bin\perl.exe -x "%~f0" %*
@exit /b %ERRORLEVEL%
#!perl
....perl program goes here...
You'll also need to change the extension of your script so that it's .cmd instead of .pl. The above trick runs the strawberry perl interpreter, calling it with the -x switch followed by "%~f0". This is the path to the .cmd script. The .cmd script will then exit once your perl program is complete.
The bit below the #!perl line is your actual perl program, which the perl.exe knows to skip to when this line runs:
@c:\strawberry-perl-port\perl\bin\perl.exe -x "path\to\my\perl.cmd" %*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With