Understanding CGI: A Perl Language
Airfare Daily Deals eCigarettes Eyeglasses Hotels Jewelry Online Backup Online Dating Online Printing Online Tickets Skin Care Textbook Rentals Vitamins Web Hosting Weddings
Find thousands of shopping-related forums
SEARCH

Understanding CGI: A Perl Language

CGI is the part of the web server that can communicate with other programs running on the server. Some of the most popular languages for CGI programming include Apple Script, C/C++, C Shell, Perl, Tcl, and Visual Basic.

CGI is the part of the web server that can communicate with other programs running on the server. With CGI, the web server can call up a program, while passing user-specific data to the program (such as what host, the user is connecting from, or input the user has supplied using HTML form syntax). The program then processes that data and the server passes the program’s response back to the Web browser.

CGI is not magic; it’s just programming with some special types of input and a few strict rules on program output. Everything in between is just programming. Of course these are special techniques that are particular to CGI.

CGI is the generic interface between the server and server-side ‘gateway’ programs. CGI specifies how data are sent to the gateway program, and how data can be returned by the gateway program, through the server and back to the browser that originally sent the data. When a web server gets a request for a static web page, the web server finds the corresponding HTML file on its file system. When a web server gets a request for a CGI script, the server executes the CGI script as another process (i.e., a separate application); the server passes this process some parameters and collects its input, which it then returns to the client.

CGI turns the web from a simple collection of static hypermedia documents into a whole new interactive medium, in which users can ask questions and run applications. Let’s take a look at some of the possible applications that can be designed using CGI.

Many languages are available for CGI programming, although certain languages are more suited for CGI programming than others. Before choosing a language, one must consider the following features.

• Ease of text manipulation.

• Ability to interface with other software libraries and utilities.

Ability to access environment variables (in UNIX).

Most CGI applications involve manipulating text some way or the other, so inherent pattern matching is very important. For example, form information is usually “decoded” by splitting the string on certain delimiters.

The ability of a language to interface with other software, such as database, is also very important. This greatly enhances the power of the Web by allowing writing gateways to information sources. The last attribute is the ease with which the language can access the environment variables. These variables contribute the input to the CGI program, and thus are very important.

Some of the most popular languages for CGI programming include AppleScript, C/C++, C Shell, Perl, Tcl, and Visual Basic.

Need an answer?
Get insightful answers from community-recommended
experts
in Computer Programming & Languages on Knoji.
Would you recommend this author as an expert in Computer Programming & Languages?
You have 0 recommendations remaining to grant today.
Comments (0)
ARTICLE DETAILS
RELATED ARTICLES
ARTICLE KEYWORDS