| 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!