in reply to Incorrect output from CGI script

Your header line in the output you refer to says: calling : http://localhost/cgi-bin/test.pl through web browser

have you called the wrong script? It certainly looks like it - the ENV script is another of the sample CGI scripts.

Replies are listed 'Best First'.
Re^2: Incorrect output from CGI script
by Anonymous Monk on Jan 26, 2005 at 16:35 UTC
    Oops, sorry it should be http://localhost/cgi-bin/myfirst_cgi.pl , I change the code name 'on the fly', really sorry. So no, I am calling the right script.

    What do you mean by ENV script btw? How/where can I get it?

      Try naming the script "myfirst_cgi.cgi" instead of ".pl". Sometimes webservers are configured to expect that. Make sure permissions are set properly for the script to be executed by your webserver also. Sometimes webservers are of group "nobody", for example. And make sure the shebang line is correct.


      Dave

      Greetings all,
      The ENV script is a script written to print out all of the name=value pairs of the the %ENV hash. The %ENV hash contains elements relating to your environment, which in most cases differs depending on where a particular script is run (i.e. executed from a web server vs. from the command line.). The output you posted looks like an ENV script as described above and the reason test.pl was mentioned is that the environment variables SCRIPT_NAME and REQUEST_URI are both set to /cgi-bin/test.pl. If this was your script it would be set to /cgi-bin/myfirst_cgi.pl.

      -InjunJoel
      "I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo