I don't have the CGI module loaded. Do I have to use it?
Quite frankly, yes. CGI is not an easy protocol to get right. Many programs that are published try to replicate the CGI module's functionality—and do so poorly. They are riddled with security problems and incompatibilities; plus, they do not follow Internet Standards as they should. In Hour 16, "The Perl Community," you learned why "reinventing the wheel" is a bad thing. CGI is an incredibly hard wheel to reinvent, and neither you nor I would get it right the first time or the hundredth time.
The Perl CGI module included with the standard distribution has been tested by hundreds of thousands of programmers and is very robust. Use it.
As I explain in Appendix A, you can install the module for just your use, if necessary. You don't have any excuse not to use it. All the examples in this book require the CGI module, and the explanations assume you have it installed.
I have this copy of cgi-lib.pl. Can I use it instead?
You really shouldn't. All the functionality of cgi-lib.pl is in the CGI module. The cgi-lib.pl library is quite old and is no longer being maintained.
Why does everyone use Perl for CGI? Why not C or TCL?
Perl has features that make it particularly useful for CGI. The short list is as follows:
Perl has excellent text-handling capabilities.
Perl's tainting capabilities—you'll learn about them soon—help make it a secure language for doing CGI programs.
Perl is an excellent glue language, good for sticking together different technologies such as operating system utilities, databases, and CGI.
Perl is easy to use.
If I have questions about Perl and CGI, should I post a message to the comp.lang.perl.misc newsgroup or at PerlMonks.org?
Probably not. A more appropriate group would be comp.infosystems.www.authoring.cgi. First, though, you should check the FAQ at http://www.w3.org/CGI/.
© 2000- NIV