in reply to Re: Trouble with Perl CGI script
in thread Trouble with Perl CGI script

Hi Sparky, Good point. I have actually two version of perl. One in usr/bin and the other is usr/local/bin which is the latest version. When running from the commandline, it uses the latter as the path is set that way. How can I tell the same when running it from the browser. Also how do I get the @INC values both from the brwser and the command line Thanks a lot Nagesh

Replies are listed 'Best First'.
Re^3: Trouble with Perl CGI script
by ChrisR (Hermit) on Jul 28, 2005 at 15:07 UTC
    To get the values in @INC, simply print @INC;. To find out which perl executable is running your script, print $^X;. My guess is that you will have to make configuration changes to the webserver to tell it which version of perl to use, although you would think it would look at the #! line.
      Ya, I think there is a setting in Apache's conf file, but it has been quite some time that I have been mucking with apache.

      Note, that most often when you can run it from the command line and it doesn't work from http, there is usialy a permissions issue. Although I have never experianced issue with modules in my @INC.

      Sparky
      FMTEYEWTK
        I thought about a permission's issue as well but the error message didn't state an error opening or executing. I looked through my httpd.conf and couldn't find anything that instructed apache to use a specific program or user to execute cgi scripts but that doesn't mean the directive isn't supported. I suppose the OP could "su - username" to the user that runs the cgi scripts and test it from the command line. In my experience that user is usually "apache" or "nobody".