Webmaster in a Nutshell

Previous Chapter 16 Next
 

Other CGI Resources

Contents:
CGI Modules for Perl 5

You can simplify many of the basic tasks of CGI programming (such as creating and decoding forms) by using the freely available CGI modules for Perl 5. Several of these are available from the Comprehensive Perl Archive Network (CPAN), the mirror sites of which follow:

ftp://ftp.funet.fi/pub/languages/perl/CPAN/
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
ftp://ftp.uiarchive.cso.uiuc.edu/pub/lang/perl/CPAN/
ftp://ftp.delphi.com/pub/mirrors/packages/perl/CPAN/
ftp://ftp.uoknor.edu/mirrors/CPAN/
ftp://ftp.sedl.org/pub/mirrors/CPAN/
ftp://ftp.ibp.fr/pub/perl/CPAN/
ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/
ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/
ftp://ftp.rz.ruhr-uni-bochum.de/pub/programming/languages/perl/CPAN/
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
ftp://ftp.sunet.se/pub/lang/perl/CPAN/
ftp://ftp.switch.ch/mirror/CPAN/
ftp://ftp.mame.mu.oz.au/pub/perl/CPAN/
ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/
ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
ftp://dongpo.math.ncu.edu.tw/perl/CPAN/
ftp://ftp.is.co.za.programming/perl/CPAN/

16.1 CGI Modules for Perl 5

The current section gives an overview of some of the available modules. The set of coordinated, commonly available CGI modules for Perl 5 are known collectively as the CGI::* modules. They are available from:

http://www-genome.wi.mit.edu/WWW/tools/scripting/CGIperl/

The CGI::* modules allow you to create and decode forms as well as maintain state between forms. A short description of each CGI::* module follows:

Base.pm

The core module that contains common methods (i.e., functions) that some of the other classes depend on. These include methods to read form information (the module does not parse or decode the data), log debug messages, implement socket I/O for maintaining state, and access and manipulate data from environment variables, such as the client's acceptable MIME content types. Base.pm represents the base class (re: object-oriented programming), from which other classes "inherit" methods and data structures; the "child" classes can override the methods from the base class to create modified functions, or implement new ones.

BasePlus.pm

A module consisting of functions to handle the new multipart forms generated by "file upload"--a feature new to Netscape 2.0. This very powerful feature allows users to send files on their local machines as part of a form; however, decoding the data can be a hassle. So you should use either this module or the CGI_Lite module to handle multipart forms.

Request.pm

Module used to parse and decode form and query data.

Form.pm

A module to help you create forms without remembering and entering every HTML tag. Also helps decode and parse form and query data easily. The functions responsible for this are inherited from the Base.pm and Request.pm modules.

MiniSvr.pm

A module that lets you implement a "mini HTTP daemon" that can be forked from a CGI application to maintain state between multiple form invocations.

Response.pm

Though not part of the official CGI module distribution at the time of this writing, this module contains functions that make it easier to output HTML headers. For example, if you want a document to be cached, you can call a method that will automatically output the Pragma and Expires headers for you.

Carp.pm

An independent module (i.e., it does not inherit any functionality from the base class), but very useful; it allows you to format error messages sent to the server log file or redirect them to the browser or another file.

There are also some independent CGI modules for Perl 5, among them:

CGI_Lite

An alternative to the CGI::* modules, this Perl 5 version of cgi-lib.pl (a version 4 library) decodes both URL-encoded and multipart form data produced by the file upload feature present in Netscape 2.0. CGI_Lite is simpler and easier to use than the core CGI modules.

Sprite

A Perl 5 module that allows you to manipulate text-delimited databases (all data and delimiters are text) using a small but important subset of SQL-92. Sprite allows you to create your own databases and access them in CGI scripts, even if you don't have a database product like Sybase or Oracle.

CGI_Lite and Sprite can be found at any of the CPAN mirror sites, under /modules/by-authors/Shishir_Gundavaram.

Additional CGI Software

The following libraries and modules are available for use with Perl 4 and/or other languages/platforms:

cgic (CGI C/C++ Library)

http://www.bio.cam.ac.uk/web/form.html

cgi-lib.pl (Perl 4)

http://www.bio.cam.ac.uk/web/form.html

EIT's CGI Library for C/C++

http://wsk.eit.com/wsk/dist/doc/libcgi/libcgi.html/

Grant's CGI Framework for the Macintosh

http://arpp1.carleton.ca/grant/mac/grantscgi.html

libwww

modules/by-authors/Gisle_A in the CPAN archives

Python CGI Library

http://www.python.org/~mclay/notes/cgi.html

uncgi

http://www.hyperion.com/~koreth/uncgi.html

Related Utilities and Applications

CGI Lint

modules/by-authors/Shishir_Gundavaram in the CPAN archives

DBI/DBperl

authors/Tim_Bunce/DBI in the CPAN archives

fakessi.pl

http://sw.cse.bris.ac.uk/WebTools/fakessi.html

GD Graphics Library

GhostScript

http://www.phys.ufl.edu/docs/goodies/unix/previewers/ghostscript.html

Glimpse

http://glimpse.cs.arizona.edu

gnuplot v3.5

ftp://prep.ai.mit.edu/pub/gnu/gnuplot-3.5.tar.gz

ImageMagick

ftp://ftp.x.org/contrib/applications/ImageMagick

mSQL

http://bond.edu.au/People/bambi/mSQL/

netpbm

ftp://ftp.x.org/R5contrib/netpbm-1mar1994.tar.gz

oraperl

http://src.doc.ic.ac.uk/packages/perl/db/perl4/oraperl

pgperl

http://www.ast.cam.ac.uk/~kgb/pgperl.html

RDB

http://www.metronet.com/perlinfo/scripts/dbase/RDB.tar.z

SWISH

http://www.eit.com/software/swish/swish.html

sybperl

http://src.doc.ic.ac.uk/packages/perl/db/perl4/sybperl

Online Documentation

AppleScript Guide to CGI Scripts

http://152.1.24.177/teaching/manuscripts/default.html

CGI FAQ

http://perl.com ftp://ftp.ora.com/published/oreilly/nutshell/cgi

CGI Security FAQ

http://www.cerf.net/~paulp/cgi-security/safe-cgi.txt

Perl Reference Guide

/doc/FAQ in the CPAN archives

SQL-92

http://sunsite.doc.ic.ac.uk/packages/perl/db/refinfo/sql2/sql1992.txt

WWW FAQ

http://www.boutell.com/faq

WWW Security FAQ

http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html

Official Specifications

CGI

http://hoohoo.ncsa.uiuc.edu/cgi/interface.html

MIME (RFC1341)

http://www.w3.org/hypertext/WWW/Protocols/rfc1341/0_TableOfContents.html

HTML

http://www.w3.org/hypertext/WWW/MarkUp/HTML.html

Netscape Extensions to HTML

http://home.netscape.com/assist/net_sites/html_extensions.html

HTTP

http://www.w3.org/hypertext/WWW/Protocols/HTTP/

URL

http://www.w3.org/hypertext/WWW/Addressing/Addressing.html


Previous Home Next
The Perl Debugger Book Index HTTP Overview