Overview

Overview
Objectives
Installing Apache
Installing Perl
Lesson 1
Hello World
Anatomy of a CGI Program
Hello World with CGI.pm
Lesson 2
HTML Forms and DOM
POST and GET
A Form Example
Lesson 3
Cookie Tutorial
Database Tutorial

Software Links
FAQ / Terminology
Contact the Author

 

This tutorial will lead you through the steps involved with setting up a Perl CGI web page. Many websites use the Common Gateway Interface (CGI) to provide dynamic webpages to their users, and the Perl programming language is a common choice for various reasons including:

  • Simple, powerful string manipulation
  • Rapid prototype design goals
  • Flexible pattern matching and substitution (regular expressions)
  • Extensive add-on libraries (CPAN)
  • Multi-platform deployment with minimal fuss
  • Abstracted database access (DBI::DBD)
  • Web server integration (Apache+mod_perl, IIS+PerlEx)
  • Safe garbage collection (no buffer-related security holes)
  • Simple integration with C and C++ for speed

A typical Perl CGI session goes something like this:

Diagram of an HTTP transaction involving CGI

The red arrows above are the CGI portion of the transaction, which as you can see amounts to a very small portion of the entire process. Describing the strict nature of CGI is not very useful to the new programmer, so this tutorial will provide some context which will speak about all the entities above in some manner of detail.


All pages written by Craig Kelley unless otherwise specified. Please use the Contact link from the menu to submit changes or suggestions. Permission is given to use this tutorial in any way you wish including re-publishing or "mirroring". The most up-to-date version of this document currently resides at http://inconnu.isu.edu/~ink/perl_cgi.

This page updated: May 6, 2002 22:21