Chapters Part I: Basic Perl Part II: Intermediate Perl Part III: Advanced Perl Part IV: Perl and the Internet Appendixes
Part I: Basic Perl
Part II: Intermediate Perl
Part III: Advanced Perl
Part IV: Perl and the Internet
If you've read the rest of this book, you have a fairly good understanding of Perl. This chapter introduces you to some resources that can take you to the next level of understanding. You can see which Usenet newsgroups are best to read, where to find Perl scripts that you can copy and modify for your own use, and other useful information.
First, you can read about Usenet, a service that uses news articles to deliver information. You can browse through the newsgroups and pick up useful information. Additionally, any time you have a question on Perl or CGI programming you can post the question to a newsgroup. Responses to questions are usually quick if your subject lines are well thought-out and descriptive.
Next, some Web sites you can visit are listed. They have useful Web, CGI, and Perl related libraries, sample scripts, and documentation that can be extremely helpful.
|If you are new to CGI programming with Perl, you will want to visit each of these sites listed in this chapter. Doing this will give you a good understanding of what is available to help you become a great CGI programmer. As you visit the sites, keep track of useful files that can be downloaded that interest you, including their version and the date. You might also bookmark the site in your web browser. When you are done visiting all the sites, you will know where to access the most recent of the tools and you can begin to download and build your own CGI development library.|
|If you are using Windows 95, you can use the news reader that comes with Netscape, or you can download Free Agent from the http://www.forteinc.com/forte/ web page.|
There are several newsgroups that are useful to Perl and CGI programmers. They are listed in Table 23.1.
|comp.lang.perl.misc||Covers general Perl questions and issues.|
|comp.lang.perl.announce||Covers Perl-related announcements.|
|comp.lang.perl.modules||Covers new module announcements and quesions.|
|comp.lang.perl.tk||Perl/Tk integration and usage discussions.|
|comp.infosystems.www. authoring.cgi||CGI issues in web authoring|
|comp.infosystems.www.announce||Not Perl-related, but very useful to monitor new developments on the web.|
|comp.infosystems.www. servers.misc||Covers general web server questions and issues. There are also newsgroups specifically devoted to individual server products.|
|comp.internet.net-happenings||Another newsgroup that good for monitoring Internet developments.|
The most useful Perl-related newsgroup is comp.lang.perl.misc because of the breadth of topics that are covered. This is the newsgroup you will most likely post to when you are having a Perl language problem or simply have a question that needs answering.
Fig. 22.1 - A Random Sample of the Articles in the comp.lang.perl.misc Newsgroup
|It is generally considered poor manners to post your question in more than one newsgroup. Most people monitor at least three of the four Perl newsgroups and will be annoyed to see your question multiple times.|
Before you post to any newsgroup. read the Perl FAQ. An FAQ is a frequently-asked questions document. If you ask a question that is already answered in the FAQ document, you will be yelled at by other people reading the list. At all times, remember that you are asking others for their help. They are under no obligation to help. If you are rude, insulting, unclear, or lazy, you can expect the same treatment in return. To quote Patrick Swayze in the movie Roadhouse, "Be polite!"
You can find the FAQ on the http://www.perl.com/perl/faq/ web page. In addition, this site will point you to other FAQs.
The comp.lang.perl.modules newsgroup is very helpful, both to check out what modules are available and how they are being used, and if you have any questions or problems with existing Perl modules, or want to ask about the existence of modules to support a particular need.
The comp.lang.perl.tk newsgroup is a forum to discuss Tk and Perl. Tk is an interface tool developed by Sun, primarily to use with Tcl, an embeddable scripting language. There have been Tk extensions made to Perl5 to allow integration. If you are interesting in using both, you will definitely want to check out this newsgroup. You can also find a FAQ at the http://w4.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html web page.
Another useful newsgroup is comp.infosystems.www.authoring.cgi. It will contain many references to CGI programming using Perl, which is one of the more popular approaches to CGI. Look at all of the newsgroups beginning with comp.infosystems.www for those that meet your needs.
Valid as of May 19, 2003 - This site contains links to Perl documentation in German and English.
The Perl language home page is connected to the Internet via a 28.8K link, so be prepared to wait a little bit while downloading. Around the end of July, the server was having difficulties staying up - hopefully they have been resolved by the time you read this.
However, when the site is available, it has valuable information. You should definitely stop in and browse.
Larry Wall is the inventor of Perl. His admirers have created this web page to commemorate some of Larry's wittier comments.
Larry as a nice guy:
Even if you aren't in doubt, consider the mental welfare of the person who has to maintain the code after you, and who will probably put parens in the wrong place. --Larry Wall in the perl man pageLarry as a philosopher:
"What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?" --Larry Wall in <1992Aug26.email@example.com>Larry as a computer nerd:
I might be able to shoehorn a reference count in on top of the numeric value by disallowing multiple references on scalars with a numeric value, but it wouldn't be as clean. I do occasionally worry about that. -lwallLarry as an programmer with impossible specifications:
You want it in one line? Does it have to fit in 80 columns? :) --Larry Wall in <7349@jpl-devvax.JPL.NASA.GOV>
One of the best places to begin a search for information or for files is at Yahoo. This is one of the better organized and comprehensive search sites on the Web.
Fig. 22.2 - The Yahoo Site
Type a keyword into the input box and click the Search button to search the Yahoo database.
Yahoo has separate categories for Perl and CGI. The Perl web page is:
And the CGI page is:
CGI.pm is a module that provides powerful functions for performing HTML form and CGI programming with Perl. This library requires Perl 5.001m, and makes use of object-oriented techniques. This is a must for your Perl bookmark list.
This attractive and very useful site contains links to many fairly sophisticated CGI scripts. For example, Web Chat 1.0 contains a slide show script, guest book, a complete shopping cart example, and many others. This site not only provides the sample scripts but you can also see them in action and view the HTML and other documents that the example uses. Additionally, the examples are fully documented, easy to understand, and are very easy to follow. Table 23.2 shows some of the scripts and their descriptions.
|Selena Sol's Electronic Outlet 2.0 (database)||Implements a shopping cart system using a database|
|Selena Sol's Electronic||Implements a shopping cart system|
|Outlet 2.0 (HTML)||using HTML|
|Cool Runnings Music Catalog||Shopping cart concept for catalogs|
|The Form Processor||Process form input, using hidden variables|
|Database Manager 2.0||A flat file database management tool|
|Database Search Engine 1.0||Search engine for the Database Manager 2.0|
|Groupware Calendar||Calendar that can be read/modified by group|
|Keyword Search Engine 3.0||Traverses HTML documents searching for keyword and returns output|
|authentification-lib.pl||Authentification perl module|
|date.pl||Date based perl module|
This site is a very comprehensive resource that the site terms a "web developer's encyclopedia." There are many tutorials on HTML, CGI, HTTP, Databases, and Style Guidelines. This site is an incredibly rich source of links to virtually any web development-related topic you can think of. The CGI page has 69 links, the HTML has 55 links, and so on. This site is definitely a must for visiting, especially when you have time to do a little link hopping and exploring, or when you need to find a web development resource.
This site explains how the CGI specification works and provides a nice set of link to other resources.
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html - FAQ
I believe that ActiveWare has the most advanced and stable Perl implementation for Windows 95 and Windows NT. They have also made a DLL available to let Perl work with the Microsoft Internet Information Server. This library will work with the Microsoft Internet Information Server to improve the efficiency of CGI access with Perl. Note that the release of this DLL may still be a beta release.
Randal is one of the most knowledgeable Perl gurus. His home page has links to some of the columns that he wrote for the Web Techniques and UNIX Review magazines.
http://www.engr.iupui.edu/~dbewley/cgi/ - CGI information
These web pages are very nicely laid out. They contain sections on books, references, tutorials, and script archives. In addition, Dale frequents the #perl and #cgi irc channels using a nickname of dwnwrd. Make sure to say hi if you see him. Figure 23.3 shows the beginning of Dale's Perl page.
Fig. 22.3 - Dale's Perl Page
Matt Wright's scripts are turning up all over the web. His Perl page has examples of guestbooks, counters, and a simple search scripts.
ftp://ftp.funet.fi/pub/languages/perl/CPAN/ - use if Perl server is done.
The Comprehensive Perl Archive Network is a set of web sites that mirror one other. The network is a volunteer organization so don't expect a lot of documentation and hand-holding. At each site, there is a sub-directory labeled /modules which will contain references to various Perl modules that are stored there. To access a list of the modules look at the /modules/01modules.index.html web page. Module development guidelines can be found at /modules/00modlist.long.html. In addition, the modules are listed by author, category, and by module.
Also, check out the /scripts sub-directory. This sub-directory is itself sub-divided into more directories, each representing a different category. Each category has scripts that can be examined, used, and modified.
http://www.fugue.com/dbi/ - DBperl mailing lists
Tim Bunce, the author of Dbperl says, "DBperl is a database access Application Programming Interface (API) for the Perl Language. The DBperl API Specification defines a set of functions, variables and conventions that provide a consistent database interface independent of the actual database being used." With DBperl you can access the following databases: Oracle, Sybase, mSQL, Informix, and Quickbase. Plans are currently underway to implement an interface for ODBC.
This famous library is widely used by many Perl/CGI programmers. The library includes functions such as ReadParse() which will parse the data passed to the script from the form, or HtmlTop() and HtmlBot() which will print out specific <head> and end of <body> sections of an HTML document.
|Before using this library, read information on the http://perl.com/perl/info/www/!cgi-lib.html web page for a cogent set of reasons why you should use the CGI.pm module instead.|
This site has a set of scripts, some created with Perl and some created with C. Among some of the scripts you can find at this site are those listed in Table 23.3. In particular check out how a simple little script such as Logger.cgi can perform a very useful function.
|MailForm.cgi||Customizable mailform CGI script that include To, Cc, and Bcc fields|
|Guestbook.cgi||Guestbook CGI script|
|Logger.cgi||Very simple script that will log visitors|
|FrameChat||Odd little application that will implement a frames based chat service. Perl 5 is required|
You will need perl5 and a UNIX-based system to use the modules listed at this site, and a copy of CGI.pm, mentioned previously.
You might think that all of the activity for CGI scripting with Perl is done only on UNIX or Windows NT. However, this site has many excellent examples of CGI scripting for the Amiga.
http://www.unimelb.edu.au/~ssilcot/macperl-primer/home.html - tutorial
http://www.marketspace.com.au/~adam/ - scripts
ftp://ftp.netcom.com/pub/ha/hal/MacPerl/faq.html - FAQ
Apple computers can also run Perl.
This site contains a nice little introduction to CGI and forms. Not only does it describe the process, it also provides graphics that demonstrate how HTML Forms/CGI interact.
If you want to learn something, sometimes you just have to go back to the source. This site provides a CGI overview. It also includes tips on writing secure CGI scripts, a topic that must always concern CGI programmers.
The University of Florida Perl page can be found at:
There are several networks that have arisen to support IRC: EfNet, Undernet, and DALnet. The Perl gurus hang out on EfNet. The #perl IRC channel is a good place to go for general Perl questions. If you have basic questions, you can try #perl-basics. CGI questions should be directed to #cgi.
The Windows 95 program mIRC has been included on the CD that accompanies this book. Install it and try connecting to one of the EfNet servers. I like to use irc.cris.com. Once connected - keep trying; it may take a few tries - type /join #perl and say hello to everyone. You might even see me - my nickname is WasWaldo.
Fig. 22.4 - A Random Snapshot of the IRC Channels.
The easiest resource to use is the Usenet newsgroups. Simply send a message to an appropriate newsgroup with a carefully worded subject line before you leave work for the evening. The odds are good that you will have a response by the next morning. Most of time you should use the comp.lang.perl.misc newsgroup.
When you have some unruly code that should work but doesn't. Consider looking on the Perl home page (http://www.perl.com/) to see if a new bug has been found.
If you need ideas or would like to get a head start on your next programming project, you can search for Perl programs at the Yahoo (http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/) web site. By starting at the Yahoo site, you always see an updated list of available Perl resources. Some sites (like Dale Dewley's - http://www.engr.iupui.edu/~dbewley/perl/) has resources that you will refer to over and over again.
Sometimes, you absolutely can't wait for an answer. When you have pressing deadlines or your brain is frazzeled, turn to the #perl channel on an Efnet IRC server.
At this point there's nothing left to say but...