magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1997 > 02 > Features  

A Perl Library for Writing CGI Scripts

Hiding the details of creating HTTP headers, parsing query strings, and maintaining state

By Lincoln D. Stein

If you're writing CGI scripts in Perl, you'll want to consider using the CGI.pm module. This library handles many fill-out forms so that you can concentrate on the task at hand. The module is widely used and frequently updated. CGI.pm combines several useful functions:

  1. Parsing of CGI query strings.
  2. Shortcuts for creating HTTP headers.
  3. Shortcuts for creating fill-out forms easily with "sticky" elements.
  4. Simplified content negotiation with the browser.
  5. Functions for handling Netscape cookies, JavaScript, frames, and so on.

CGI.pm uses Perl 5's object-oriented style of programming. To use it, you'll need Perl 5.001 or higher — Perl 5.003 is recommended. It runs correctly on all major platforms, including UNIX, Windows 95, Windows NT, and Macintosh. You'll find this module on the Internet in the Perl CPAN archives, or you can go directly to CGI.pm's home site; see " Online." CGI.pm is available at this site in UNIX tar, Windows zip, and Macintosh sea archive formats.

Using CGI.pm

In CGI.pm, everything is done through a CGI object. At the beginning of your script, you create a new CGI object that parses the CGI parameters and stores the results within itself.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2