Logo         Community
The Company
Your Account
Contact Us
CGI.pm Basics
The CGI.pm module offers Perl programmers powerful page construction and form parsing capabilities.

| The Wonder That Is CGI.pm |

First, we need to get the definitions down. In case you're wondering what a module is, don't - for the purpose of this article, just assume that it's a thingamajig that allows you to add new capabilities to your Perl program, or a series of pre-rolled functions which can be plugged in to your Perl program.

There are a number of such modules out there - CPAN, the Comprehensive Perl Archive Network, at http://www.cpan.org/ , has a complete list - and most are available free of charge, and are simple to import into your Perl program. If you're running a fairly recent version of Perl - say, 5.004 or higher - you probably already have CGI.pm installed as part of your distribution; if not, drop by CPAN and get yourself a copy.

You're probably wondering just what CGI.pm brings to the Perl party. Let me enlighten you.

In the Perl 101 series, we showed you to how to roll your own functions to parse the query strings generated when a form is submitted. With CGI.pm, all that is history - the module comes with powerful parsing capabilities that assist in the icky task of parsing query strings and separating them into individual name-value pairs.

Next, it also comes with some neat functions that simplify the task of writing HTML code. No more coding your way through <TABLE>s and <FORM>s - CGI.pm can generate them for you with simple, easy-to-understand-and-remember commands.

Finally, CGI.pm is written in the best traditions of object-oriented programming, fondly known as OOP. All the activities I've described above take place through a CGI object, which has its own methods and properties. In case you don't know what OOP is, you're probably not impressed. Don't worry about it - it's a good thing, and I'll be covering the basics of OOP in Perl in a separate article very soon.

How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!

previous page more like this  print this article  next page
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
In cut!...
American Chai
The Core
Find out how you can use this article on your own Web site!

Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback