• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part V: CGI and Perl > The CGI.pm Module

Chapter 14. The CGI.pm Module

CGI.pm is a Perl module for creating and parsing CGI forms. It is distributed with core Perl as of Perl 5.004, but you can also retrieve CGI.pm from CPAN, and you can get the very latest version at any time from ftp://ftp-genome.wi.mit.edu/pub/software/WWW/. Due to space constraints, this book doesn't include a complete reference for the Perl language itself. But if you already use Perl for CGI, you know how essential CGI.pm can be, so we include this chapter on CGI.pm as a convenience for Perl-savvy readers.

CGI is an object-oriented module. Don't let the object-oriented nature scare you, though; CGI.pm is very easy to use, as evidenced by its overwhelming popularity among all levels of Perl programmers. To give you an idea of how easy it is to use CGI.pm, let's take a scenario in which a user fills out and submits a form containing her birthday. Without CGI.pm, the script would have to translate the URL-encoded input by hand (probably using a series of regular expressions) and assign it to a variable. For example, you might try something like this:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint