[logo] The cgi-lib.pl Home Page

Intro / Documentation / Examples / Books


The cgi-lib.pl library was the de facto standard library for creating Common Gateway Interface (CGI) scripts in the Perl language. Welcome to the official Web site for cgi-lib.pl.

The cgi-lib.pl library makes CGI scripting in Perl easy enough for anyone to process forms and create dynamic Web content. The library has the following features:

Current versions of cgi-lib available:

Note: In order to prevent servers from actually executing the library, a .txt suffix has been added to the filename for cgi-lib.pl. After downloading the files, you will need to remove the .txt suffix before using the library. That is, after download, you should ensure that the the name of the file on your system is cgi-lib.pl.


The official documentation for cgi-lib.pl applies only to version 2 of the library. However, a number of tutorials that describe how to use cgi-lib.pl in your own scripts can be found online on the WWW.

Tutorial Examples

Perl4 and Perl5

It is extremely easy to use cgi-lib.pl, and most people can pick it up from just a few examples. The following scripts work equally well under Perl4 and Perl5


The above examples are also available in a form which uses Perl5 idiom. (The scripts above run on both Perl4 and Perl5, whilst those below only run on Perl5.) Note that all of these scripts incorporate -Tw and use strict which turns on taint checks for security as well as warnings and strict to help you avoid making stupid mistakes.

Books discussing cgi-lib.pl

The cgi-lib.pl library is described in a large number of widely available books. Following is a list of some which have Web pages.


cgi-lib.pl was written by Steven E. Brenner. Thanks are due to many people for reporting bugs and suggestions especially Meng Weng Wong, Maki Watanabe, Bo Frese Rasmussen, Andrew Dalke, Mark-Jason Dominus, Dave Dittrich, Jason Mathews, Tom Christiansen, Andre Pool, Matthew Baird, Roman Pozlevich, Ryutaroh Matsumoto, Roger D. Linder. Edwin Aoki has provided much help with documentation, examples, and support for cgi-lib.pl.

Intro / Documentation / Examples / Books

Copyright © 1998 Steven E. Brenner / cgi-lib@pobox.com
$Date: 1998/02/20 05:08:40 $