Perl has become very popular, both because of its ease of use in proportion to its capability and because it is freely and easily available for many different operating systems. Appendix A, "Perl Acquisition and Installation," describes where you can access Perl for your operating system and provides some installation instructions for some of the most popular operating systems. This appendix lists some of the Internet sites where you can get Perl-related libraries, scripts, documents, and other goodies.
The first section describes usenets that you can browse through and pick up useful information. Additionally, any time you have a question on Perl or on CGI programming, you can post to one of these groups and usually get at least one response within eight hours.
The second section describes sites that have useful Web-, CGI-, and Perl-related libraries, samples, code, and documentation that can be extremely helpful. The sites might also include libraries for database access and for other important Internet and intranet activities.
The last section describes sites that have useful Perl libraries,
samples, code, and documentation that are not necessarily Web-related.
TIP |
If you are new to CGI programming with Perl, you will want to visit each of the sites listed in this appendix. Doing so will give you a good understanding of what scripts, libraries, modules, and documentation are available (in addition to this book) to help you become a great CGI programmer. As you visit the sites, jot down the downloadable files that interest you, including their versions and the date. When you finish visiting the sites, you will know where to access the most recent tools, and you can begin to download and build your own CGI development library. |
One of the most useful Perl-related sites is comp.lang.perl. This site is the one that you will most likely post to when you have a perl-language problem or general perl-language question. Now that I've said that, I want to recommend yet another extremely useful site, which is comp.lang.perl.misc. If comp.lang.perl does not have what you need, comp.lang.perl.misc probably will, especially in regard to Perl on various operating systems and Perl in comparison with other tools, such as Tcl. Both of these sites are useful and should be on your subscribe-to list. Before you post at either of these usenets, you might want to read the Perl FAQ at http://www.perl.com/perl/faq/. In addition, this site points you to other FAQs.
To see the latest Perl-related announcements, check out comp.lang.perl.announce. You should also check out the CPAN sites (listed in Appendix A and repeated later in this appendix) for announcements of new releases. In addition, you can find archives of this usenet at any of the CPAN sites, in the /CLPA subdirectory.
The usenet comp.lang.perl.modules is very helpful if you want to check out what modules are available and how they are being used, if you have questions about or problems with existing Perl modules, or if you want to ask about the existence of modules to support a particular need.
The last perl-specific usenet is comp.lang.perl.tk. Tk is an interface tool (developed by Sun) primarily for use with Tcl, an embeddable scripting language. Tk extensions to Perl 5.0 have been made to allow integration. If you are interested in using both tools, you definitely want to check out this usenet. You also can find a FAQ for this usenet at http://w4.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html.
Another useful usenet is comp.infosystems.www.authoring.cgi. This group contains many references to CGI programming with Perl, which is still one of the most popular approaches. You will want to glance through all the usenets that begin with comp.infosystems.www to find those that best meet your needs.
Table B.1 recaps the usenets discussed in this section.
Usenet Name | Subject |
comp.lang.perl | General perl language discussions |
comp.lang.perl.misc | General perl language and tool discussions |
comp.lang.perl.announce | Perl-related announcements |
comp.lang.perl.tk | Perl/Tk integration discussions |
comp.infosystems.www. | CGI issues in Web authoring authoring.cgi |
The following sites are terrific places to visit to build up your CGI script library. In addition, the sites give you an idea of what you can use or modify for your own use. You will be amazed by the amount of freeware and shareware that is available.
One of the best places to begin a search for information or files is Yahoo (see fig. B.1), which is one of the best organized and most comprehensive search sites on the Web. You can access Yahoo at http://www.yahoo.com.
Figure B.1 : This figure shows the Yahoo WWW site.
To find several sources that have Perl-related information, access Yahoo's site on Perl programming at http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/. You can access information on CGI programming in general by starting at http://www.yahoo.com/Computers_and_Internet/Internet/World_Wide_Web/CGI_Common_Gateway_Interface/. In addition, you can access http://www.yahoo.com/Computers_and_Internet/Internet/World_Wide_Web/Programming/ to find information that is specific to programming on the Web, including a section on Perl scripts.
One of the most important libraries for CGI development with Perl is cgi-lib.pl, created by Steven Brenner. You can find this simple, easy-to-use library-as well as instructions on its use and examples of using it-at http://www.bio.cam.ac.uk/cgi-lib/. The library includes functions such as ReadParse (which parses the data passed to the script from the form) and HtmlTop/HtmlBot, which print specific <HEAD> and end-of <BODY> sections of an HTML document. This library, which works with Perl 4.0 and Perl 5.0, is a must to review and use.
cgi.pm is another CGI perl library that provides powerful functions for performing CGI programming with perl. This library, which requires Perl 5.001m, uses Perl 5.0 objects for Web-related activity. This library is another must for your perl-library list. Access the documentation, source code, and samples at http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html.
This site has a set of scripts, some of which were created with
perl and some of which were created with C. Table B.2 lists some
of the scripts that you can find at this site. In particular,
check out the simple script Logger.cgi, which performs
a very useful function. You can reach the site at http://www.selah.net/cgi.html.
Script/Module | Covers |
MailForm.cgi | Customizable mail-form CGI script |
Guestbook.cgi | Guestbook CGI script |
Logger.cgi | Simple script that logs visitors |
FrameChat | Odd little application that implements a frames-based chat service (requires Perl 5.0) |
Sites such as this one mean that CGI/Perl programmers will have an easier time. The modules provided at this site take form contents; perform some processing; and output the result to e-mail, a file, or communication with the Web page reader, or return a new URL. You need Perl 5.0 and a UNIX-based system to use the modules listed at this site. You also need a copy of cgi.pm (discussed earlier in this chapter), as well as pipeline.pl (which is available with the HFPM distribution).
You can reach the site at http://seclab.cs.ucdavis.edu/~hoagland/hfpm/.
This attractive and very useful site contains links to many fairly sophisticated CGI scripts, such as Web Chat 1.0, a slide-show script, a guestbook script, and a complete shopping-cart example. This site not only provides the sample scripts, but also allows you to see them in action. In addition, you can view the HTML and other documents that the examples use. The examples are fully documented and easy to understand.
This site is a must-visit site; you can reach it at http://www2.eff.org/~erict/Scripts/.
Table B.3 lists some of the samples and describes what they do.
Example | Description |
Selena Sol's Electronic Outlet 2.0 (database) | Complete set of files to implement a databaselike shopping-cart system |
Selena Sol's Electronic Outlet 2.0 (HTML) | Same as preceding example, but HTML-based |
Cool Runnings Music Catalog | Shopping-cart concept for catalogs |
The Form Processor | Processes form input, using hidden variables |
Database Manager 2.0 | Flat-file database management tool |
Database Search Engine 1.0 | Search engine for Database Manager 2.0 |
Groupware Calendar | Calendar that can be read/modified by group |
Keyword Search Engine 3.0 | Traverses HTML documents, searches for keyword, and returns output |
authentication-lib.pl | Authentication perl module |
date.pl | Date-based perl module |
This site is a very comprehensive resource, self-described as a "Web developer's encyclopedia." The site is located at http://www.stars.com. Useful documents include tutorials on HTML, CGI, HTTP, databases, and style guidelines.
When you access the Library of Web Development at http://WWW.Stars.com/Vlib/, you will think that you have died and gone to some version of a pleasant afterlife. Accessing the encyclopedia only confirms this thought. This site is an incredibly rich source of links to virtually any Web development topic that you can think of. The CGI page has 69 links, the HTML has 55 links, and so on.
This site is a definite must to visit, especially when you have time to do a little link-hopping and exploring or when you need to find a Web development resource.
Another excellent resource for CGI scripts, this site has several CGI script examples, listed by category. The site uses HTML tables to provide the name of the script's author, a description of the script, the type of script, the language, and a link to the file(s). You can reach the site at http://www.virtualville.com/library/scripts.html. The site also contains an introduction to CGI at http://www.virtualville.com/library/cgi.html.
The categories listed at the site are:
Lest you think that all CGI scripting with Perl is done only in UNIX or Windows NT, this site has many excellent examples of CGI scripting, including animation, bulletin boards, calendars, counters, and mail. You can reach the site at http://www.netlink.co.uk/users/PureAmiga/pcgi/index.html.
Some helpful MacPerl scripts are available at Adam's Perl Page, located at http://www.marketspace.com.au/~adam/. You can find the MacPerl home page at http://err.ethz.ch/~neeri/macintosh/perl.html, a MacPerl primer at http://www.unimelb.edu.au/~ssilcot/macperl-primer/home.html, and the MacPerl FAQ at ftp://ftp.netcom.com/pub/ha/hal/MacPerl/faq.html.
A helpful site for information on the Perl for Win32 port is http://www.perl.hip.com/PerlFaq.htm. The company that maintains this site also provides what is considered to be the most stable port for Windows NT and Windows 95.
In addition, a Dynamic Link Library (DLL) called PERLS.DLL is available at http://www.perl.hip.com/perlis.htm, This library works with the Microsoft Internet Information Server to improve the efficiency of CGI access with Perl. Notice that the release of this DLL might still be a beta release.
This site, which contains a nice little introduction to CGI and forms, can be reached at http://kufacts.cc.ukans.edu/info/forms/forms-intro.html. The site not only describes the process, but also provides graphics that demonstrate how HTML forms and CGI interact.
If you want to learn something, sometimes you have to go back to the source. This site, at http://hoohoo.ncsa.uiuc.edu/docs/cgi/, provides a CGI overview. The site also includes tips on writing secure CGI scripts-an activity that must always concern CGI programmers.
Yahoo maintains a site that covers server-side includes (SSI). You can reach the site at http://www.yahoo.com/Computers_and_Internet/Internet/World_Wide_Web/HTTP/Servers/Server_Side_Scripting/ Server_Side_Includes_SSI_/. (Access probably will be faster if you access Yahoo at www.yahoo.com and then follow the links until you access this site, rather than try to type the entire URL.)
From this site, you can access a helpful tutorial on SSI, located at http://www.carleton.ca/~dmcfet/html/ssi1.html. Additionally, although SSI works with a Web server such as NCSA HTTPd (http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html), it does not work with the CERN server. You can, however, access a Perl module, fakessi.pl, at http://sw.cse.bris.ac.uk/WebTools/fakessi.html. This module provides SSI-like functionality.
This section lists sites that contain references to standard Perl material that may not be Web- or CGI-related but that can be used regardless of application type.
When you are working with Perl, you will want to review some of the basic Perl documentation. Check out the following sites:
CPAN stands for Comprehensive Perl Archive Network.
Table B.4 lists the CPAN sites.
The CPAN sites have a subdirectory labeled /MODULES, which contains references to various Perl modules that are stored at each of the CPAN sites. To access a list of the modules, access the subdirectory at /modules/01modules.index.html. You can find a description of a standard for development for the modules at /modules/00modlist.long.html. The modules are listed by author, category, and by module.
An additional subdirectory to check out is the /SCRIPTS subdirectory at each CPAN site. This subdirectory is itself divided into subdirectories, each of which represents a different category. Each category can have one to many Perl scripts that you can examine, use, and reuse.
DBI, which is the Perl Database Interface, is a database API for Perl. The best place to access information about this interface is http://www.hermetica.com/technologia/DBI/index.html. You can download the most recent copy at http://www.hermetica.com/technologia/DBI/DBI/index.html. In addition, you can access any of the existing drivers from this site. Some of the available drivers are for the Oracle, Sybase, mSQL, Informix, and Quickbase databases. Plans are currently under way to implement an interface for ODBC.
An additional site for information on DBI is located at http://www.fugue.com/dbi/. You can also subscribe to three DBI mailing lists at this location.
gd is a graphics library that was originally written (and still is written) in C, but a version of gd has been ported to Perl. You can access this library at http://www-genome.wi.mit.edu/ftp/pub/software/WWW/GD.html. This library allows you to create three classes: Image, Font, and Polygon.
This Perl library parses the output of the sgmls and nsgmls parsers, which you can find at http://www.jclark.com/sp/index.htm. The Perl library is located at http://www.uottawa.ca/~dmeggins/SGMLSpm/definition.html. A sample application, sgmlspl, is documented; you can reference it at http://www.uottawa.ca/~dmeggins/sgmlspl/definition.html.