At 05:38 PM 2/20/04 -0500, you wrote:
I am on Windows. Is it okay for me to put a unix style shebang line in my scripts? I would do this for the scripts that I intend to run across platforms. I think the shebang is mostly ignored on Windows.

Ex: #!/usr/bin/perl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Robert:

The "shebang" line has (at least) 2 uses in windows:

1) You can develop your code locally for a number of platforms (ie. prototype your code at the kids' soccer game on your windows laptop & later send it to the server..)

2) Put your script in a 'bat' file so you can call it with the "-x" switch and do some checking ...

@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!/usr/bin/perl -w
# your code goes here
#




Reply via email to