in reply to printenv not displaying results

If your script is called printenv.pl, then perhaps URL should be http://localhost/cgi-bin/printenv.pl ?

Update: Also HTTP 400 is a Bad Request, Page Not Found is 404. What error are you getting?

Replies are listed 'Best First'.
Re^2: printenv not displaying results
by manishrathi (Beadle) on Jan 12, 2010 at 00:44 UTC
    1 I tried using http://localhost/cgi-bin/printenv.pl, but I get the same result 'page not found' http 400. I tried using localhost:80 also.

    2 yes, I am getting 'page not found' error and there is http 400 besides it

    oh vow, its running now. when I typed http://localhost/cgi-bin/printenv.pl, it did run and asked me to run or save the printenv file. When I clicked on run, it just run but did not display any output on console. Why is that ? second time, I saved output on desktop and I can see printenv file on the desktop (without any .pl extension). when I click on this file, it just runs and does not open. When I open with notepad, then I can see the output. why is that ? why is there no extension on the output file ? There is no extension on the file in cgi-bin dir also. Its there as printenv. How does perl interpreter understand that this is perl file without .pl extension ? If I have pHp interpreter also set in the environment variable path, which ijnterpreter will execute this printenv file, which does not have an extension ?
      An executable script starts with a call to the interpreter to be used, in this case something akin to
      #!/usr/bin/perl
      This is the interpreter used to run the script.

      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
      How does perl interpreter understand that this is perl file without .pl extension ?

      You're dealing with Apache, Apache decides what to call, how, and when.