[San-Diego-pm] Shebang path issue

Chris Grau chris.grau at gmail.com
Fri Nov 22 11:39:12 PST 2013


It's not that Perl on Windows ignores the #! line, it's that Windows
doesn't use it. It's a Linux thing (by which I mean *nix, but most
people use Linux these days). The program loader uses it to find the
interpreter to use. Windows instead uses registry entries to associate
file extensions with programs.

In any case, running 'perl script.pl' in either Linux or Windows will
use whatever 'perl' shows up first in the path.

Apache on Windows will use the #! line to find the interpreter, since
it doesn't have any other way of doing so. I assume, then, that you've
installed Perl on Windows under 'C:\perl'.

If that works, what workaround are you looking for?

On Fri, Nov 22, 2013 at 11:20 AM, Joel Fentin <joel at fentin.com> wrote:
> At the perl meeting last night, I was told that perl in windows ignores the
> shebang. What I should do is move the perl path to the left of all other
> path statements to get it to work that way.
> I changed the path here:
> Start>Settings>Control Panel>System>Advanced>Environment Variables
>
> It's true if I shell to DOS and type:
> C:\Apache2.2\cgi-bin\Learn>perl showmodules.pl
> The program works and shows me the perl modules.
>
> However, if I am running the Apache server, and I type:
> http://127.0.0.1/cgi-bin/Learn/showmodules.pl
> The she shebang must be:
> #!/perl/bin/perl
>
> #!/usr/bin/perl will not work.
> Is there a reasonable workaround?


More information about the San-Diego-pm mailing list