HTML CSS PHP PERL

Q&A

 
Previous Table of Contents Next

Q&A

Q1:

I don't have the CGI module loaded. Do I have to use it?

A1:

Quite frankly, yes. CGI is not an easy protocol to get right. Many programs that are published try to replicate the CGI module's functionalityand 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.

Q2:

I have this copy of cgi-lib.pl. Can I use it instead?

A2:

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.

Q3:

Why does everyone use Perl for CGI? Why not C or TCL?

A3:

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 capabilitiesyou'll learn about them soonhelp 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.

Q4:

If I have questions about Perl and CGI, should I post a message to the comp.lang.perl.misc newsgroup or at PerlMonks.org?

A4:

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/.

    Previous Table of Contents Next
    © 2000- NIV