nadarajan has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have installed xampp on windows 7, which includes apache. I am using the cgi-bin folder within the C:\xampp folder to host and test my perl cgi scripts. I have installed both strawberry and activestate perl 5.16 on my machine and included the path as part of the environment variable. Still, I have to use the following line, #!"C:\Perl64\bin\perl5.16.2.exe" at the top of each cgi files, to work properly. Otherwise apache throws error saying "Error message: couldn't create child process: 720002: ". Although I am pointing to perl version 5.16, when I print the version from the cgi files, it shows that the version is 5.0. Because of this I am unable to use the line "use Modern::Perl;". Please let me know how to resolve these two issues. Issue 1: Avoid the use of the line #!"C:\Perl64\bin\perl5.16.2.exe" on each cgi page. 2. How to point to perl version 5.16. Thanks
  • Comment on How to point to the latest verion of perl on cgi files

Replies are listed 'Best First'.
Re: How to point to the latest verion of perl on cgi files
by Corion (Patriarch) on Nov 04, 2013 at 07:46 UTC

    I don't think that Apache lets you avoid the "hashbang" line. This is likely a security feature so that only the explicit version of the Perl interpreter that you want gets invoked.

    How do you print the Perl version? I find it hard to believe that any current XAMPP distribution distributes Perl 5.005_05 or anything from before the three-point-versions.

    As a third question, what did you try to install Modern::Perl, and how did it fail?

Re: How to point to the latest verion of perl on cgi files
by GrandFather (Saint) on Nov 04, 2013 at 08:14 UTC

    My reading of the brief information at http://www.apachefriends.org/en/xampp-windows.html indicates that xampp 1.8.2 includes "Strawberry Perl 5.16.3.1" which suggests either you are using a (much) older version of xampp, or you have a configuration issue.

    Windows doesn't take any notice of the #! line at the top of script files, but Apache acts like a *nix a shell and requires the line to figure out what interpreter should be used.

    True laziness is hard work
Re: How to point to the latest verion of perl on cgi files
by Anonymous Monk on Nov 04, 2013 at 14:39 UTC
    When you define your virtual-host and/or directories within that host, you should be able to specify not only that "Perl" is to be used, but what is the path to it. Show us the relevant portions of your Apache config.