in reply to CGI program
There seems to be some misunderstanding of what CGI is and how it's utilized. Some people say it's just the way you pass parameters to and from scripts (url?some_var=some_val), but my understanding is that this is wrong. CGI is a specification for your web server to communicate with your script. The way it communicates is by a series of environment variables guaranteed to be there and with specific uses. For example, QUERY_STRING, REQUEST_METHOD, etc. These are all listed in the RFC.
The nice thing about programming perl for CGI is that we have the nifty CGI module (or any of the other, smaller ones) that examines all those environment variables and provides functional or OO interfaces to the relevant information they contain. So instead of having to parse $ENV{'QUERY_STRING'} manually, the CGI module does it for us. In addition, the CGI specification provides a way to access things like the server name, the script name, the remote host, etc.
The RFC describes this succinctly:
The nice thing about programming perl for CGI is that we have the nifty CGI module (or any of the other, smaller ones) that examines all those environment variables and provides functional or OO interfaces to the relevant information they contain. So instead of having to parse $ENV{'QUERY_STRING'} manually, the CGI module does it for us. In addition, the CGI specification provides a way to access things like the server name, the script name, the remote host, etc.
The RFC describes this succinctly:
The server acts as an application gateway. It receives the request from the client, selects a CGI script to handle the request, converts the client request to a CGI request, executes the script and converts the CGI response into a response for the client. When processing the client request, it is responsible for implementing any protocol or transport level authentication and security. The server MAY also function in a 'non-transparent' manner, modifying the request or response in order to provide some additional service, such as media type transformation or protocol reduction.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: CGI program
by manishrathi (Beadle) on Sep 23, 2009 at 17:49 UTC | |
by moritz (Cardinal) on Sep 23, 2009 at 18:12 UTC | |
by manishrathi (Beadle) on Sep 23, 2009 at 18:56 UTC | |
by moritz (Cardinal) on Sep 23, 2009 at 19:00 UTC | |
by manishrathi (Beadle) on Sep 24, 2009 at 16:08 UTC | |
|
In Section
Seekers of Perl Wisdom