CGI Programming on the World Wide WebBy Shishir Gundavaram
1st Edition March 1996
This book is out of print, but it has been made available online through the O'Reilly Open Books Project.
It really depends on what you are trying to do. The CGI modules should generally be used for heavy-duty CGI scripts. For simple scripts, it is far easier and quicker to roll your own or use CGI Lite (current version is v1.62 http://bytor.engr.wisc.edu/pub/perl/cpan/authors/id/SHGUN/CGI_Lite-1.62.pm.gz). If you really want, you can even use the Perl 4 cgi-lib.pl library (http://www.bio.cam.ac.uk/web/form.html).
Most modules have manpages embedded within the module itself. If that is the case, you can use the pod2man script to view the manpage:
% pod2man module.pm | nroff -man | more
The most widely used CGI library for Perl 4 is cgi-lib.pl written by Steven Benner (http://www.bio.cam.ac.uk/web/form.html). It is very, very simple to use!
- CGI::* Modules
These modules allow you to create and decode forms as well as maintain state between forms.
- CGI Lite
An alternative to the CGI::* modules. It is a glorious Perl 5 version of cgi-lib.pl.
Both of these modules have the ability to decode the multipart/form-data encoding scheme.
Why are so many of these CGI Perl libraries object oriented? I don't know O-O programming. Aren't there simpler libraries for non-programmers to use? How hard can it be?
You can use cgi-lib.pl (http://www.bio.cam.ac.uk/web/form.html), which is not object oriented, because it was designed for Perl 4.
But, using the Perl 5 O-O libraries is a piece of cake! Here is a simple example that uses CGI Lite (http://bytor.engr.wisc.edu/pub/perl/cpan/authors/ id/SHGUN/CGI_Lite-1.62.pm.gz) to print out form data:
#!/usr/local/bin/perl5 use CGI_Lite; print "Content-type: text/plain", "\n\n"; $cgi = new CGI_Lite () $cgi->parse_form_data (); $cgi->print_form_data (); exit (0);
Back to: CGI Programming on the World Wide Web
© 2001, O'Reilly & Associates, Inc.