in reply to Re^5: $ENV{'REQUEST_METHOD'} undefined?
in thread $ENV{'REQUEST_METHOD'} undefined?

I supose I should back up a bit. This script is invoked by the default page of the site which is as follows. It explicitly sets REQUEST_TYPE to POST.

<html> <head> <title>Redirecting...</title> </head> <body onload="document.forms['main_loop'].submit();"> <form action="/cgi-bin/index.pl" method="post" name="main_loop"> </form> </body> </html>

What do you mean by "run as CGI?"

I understand the benifits of using CGI, but considering the amount of time I have put into this and lack of time I have to complete it, and since I imagine it would take quite a long time to convert the 6000+ lines of code in this script to use CGI, I would like to continue without it. I have plans for a second version of this script and intend to study up and use CGI, but for the time being I need a working version ASAP.

Thank you again for the help...much appreciated. :)

Replies are listed 'Best First'.
Re^7: $ENV{'REQUEST_METHOD'} undefined?
by moritz (Cardinal) on Nov 30, 2009 at 14:01 UTC
    The typical data flow for a perl script serves a web page looks like this:
     Web browser  ---->  Web server ----->  +--------+
                  HTTP               CGI    | Your   |
                                            | Perl   |
                                            | script |
     Web browser <----- Web server <------  +--------+
    

    CGI refers to a protocol for exchanging data between the web server and your perl script. (It is not the CGI perl module).

    There are other methods for communicating between a perl script and a web server, popular ones include FastCGI and mod_perl.

    So, for answering the question whether your program runs a CGI script you have to look into the configuration of your web server. Using the CGI Perl module doesn't change that, it just makes your program simpler.