CGI Scripting
Perl CGI Index
Basic CGI Scripting
Simple CGI Demo
Styling CGI Output
Sharing Perl Code
CGI Code Suite
CGI Environment
Next section...
Web Applications

CGI Scripting

Perl CGI Overview

Ordinary webpages are static, that is to say the same page will be served each time. However, dynamic pages are also possible using executable resources on the server that will generate the required page on demand with the relevant data and serve it in the same way as a static page.

CGI = Common Gateway Interface

In essence this 'gateway interface' is a protocol by which user data from forms and other objects within webpages can be passed via the HTTP stream to the programs on the server as arguments. These programs then return the relevant output in the form of a text stream that contains the necessary HTML to form the page.

On receipt back in your browser this output is parsed just as static HTML, your browser makes no distinction between static or dynamic resources as the results are identical.

The executable programs can be coded in any language that can be executed on the server and has the necessary functionality to extract the CGI arguments. The most commonly used languages are C (and derivatives), VB, Perl, PHP and Python.

Here we will deal strictly with Perl which is not technically a programming language but a scripting language as it uses scripts parsed by the Perl interpreter rather than compiled executable resources as with C or similar. However the difference is largely irrelevant here, script or program, the server causes it to be executed and returns its output via the HTTP stream.

It is also assumed that you are reasonably familiar with Perl as a scripting language, this isn't a guide to coding Perl, rather an overview of its applications and efficient use.

Show Style-Switcher...