I have set up a local Perl web environment on my Windows machine. The application I\'m working on is originally from a Linux server, and so the shebang for source .pl<
I use #! /usr/bin/env perl
as the shebang on all of my perl, whether on *nix or Windows. Windows just ignores it, and the Unixen follow env to the chosen perl disto.
I use #!/usr/bin/perl
in my scripts and configure Apache on Windows to ignore the shebang line. Add
ScriptInterpreterSource Registry-Strict
to your httpd.conf
and set up the Windows Registry key as explained in the Apache docs.
Here is what I get when I export the key:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.pl\Shell\ExecCGI\Command] @="c:\\opt\\perl\\bin\\perl.exe"
I have been using this setup with Apache and ActiveState Perl on my Windows laptop and the Apache and Perl distributions that come with ArchLinux on my server.
The Apache docs (to which I linked above) state:
The option Registry-Strict which is new in Apache 2.0 does the same thing as Registry but uses only the subkey
Shell\ExecCGI\Command
. TheExecCGI
key is not a common one. It must be configured manually in the windows registry and hence prevents accidental program calls on your system. (emphasis mine)