in reply to Re^3: CGI program
in thread CGI program

Are these variables created by web server, irrespective of whether CGI API is used in a script or not or are they created only when CGI API is used by a script ?
These variable get their names only after they web server creates them and assigns values. But how are they named , when they are received by the webserver ? For example, will QUERY_STRING have different name before its named by web server ?

Replies are listed 'Best First'.
Re^5: CGI program
by moritz (Cardinal) on Sep 23, 2009 at 19:00 UTC
    The web server has a configuration file which tells it if a certain program is to be run as a CGI script or not. If the answer is "yes", the web server sets up all these variables before calling the script.
    For example, will QUERY_STRING have different name before its named by web server ?

    The web server likely has an internal data structure that holds that information - it doesn't matter how that thing is called.

    Perl 6 - links to (nearly) everything that is Perl 6.
      So when I create a Perl script with the "use CGI" in the script and save this file as say "trialOfCGI.pl", will it be automatically marked as CGI script ? Or do we have to manually mark the script as CGI ? If we save the file with .cgi extension e.g. "trialOfCGI.cgi", does it mark the script as CGI script ? If thats the case, then every CGI script has to be marked with cgi extension only ? When do we use cgi extension for a script ? In the cgi-bin dir, can we put a script without .cgi extension ?
        The webserver controls all that. If it wants .vagina, you need .vagina :)