Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: CGI program

by moritz (Cardinal)
on Sep 23, 2009 at 18:12 UTC ( [id://797047]=note: print w/replies, xml ) Need Help??


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

The CGI specification requires the web server to set these environment variables. The script is then free to do with these variables what it wants.

You don't need to use the module CGI.pm to access these variables, but it provides a convenient way to do it.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^4: CGI program
by manishrathi (Beadle) on Sep 23, 2009 at 18:56 UTC
    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 ?
      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 ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://797047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found