CGI and Perl

A CPAN Overview

You'll see the CPAN (Comprehensive Perl Archive Network) referred to many times in this text, and after some consideration, we've decided that the overview of what it is, its history, how it works, and why it's so important belongs here, in the first chapter, rather than in the appendix. The CPAN, with its vast resources and tools, is the foundation of this tutorial. We'll do very little without the help of a module, extension or other tool, including the source code for Perl itself, from the CPAN.

CPAN History

When this author first discovered Perl in 1990, there was little or no means to bootstrap oneself into the learning phase of programming Perl. The version that was available to me at that time was 3.10, and it wasn't very easy to learn, unless one was already familiar with the sed, grep, awk, and other languages, including C, along with those dreaded UNIXisms, Regular Expressions. The UNIX manpage for Perl was long and tedious to read, and made many assumptions about the level of the reader, in terms of UNIX knowledge. At that time, I resolved that if I ever had a chance, I'd try to do something about that.

When the comp.lang.perl newsgroup came along, the common folk suddenly had access to the few true Perl wizards which existed at the time, including Larry himself, along with Randal and Tom, Mark Biggar, and a few others who either worked with Larry, were related to him, or had jumped onto the Perl bandwagon very early on. This made things a little easier when one had a problem, but the Usenet protocol, at that time, was quite a bit more respected, and thus I was a bit shy about posting arbitrary bonehead questions.

Then, in 1991, the first version of the Camel was printed, along with UUNET, the examples which were given in the text, as a single compressed tar file. Suddenly, everything got a little easier. One could purchase the Camel, and then follow along directly with the examples. This still wasn't enough to become an expert, or even accomplish any given task, but it was a starting point.

Finally, in late 1991, I co-founded one of the first Mom 'n Pop ISPs in the country, Texas Metronet. Almost as soon as I had the root password, I took the collection of scripts which I'd gathered on the newsgroup, along with some of the other things I'd seen around here and there, and created a little ftp area, with some general hierarchy, including admin stuff, networking stuff, UI stuff, and assorted stuff; and the first "organized" Perl archive available on the Net was born. Now anyone could connect to this archive, and hopefully find a little ditty which would help them accomplish the task they had at hand, or at least get them started.

Since then, there's been a mailing list formed for discussion of matters relevant to archiving Perl, and, more importantly, the efforts of many separate Perl archivists all over the Net has been unified and integrated into a single, comprehensive effort known as the CPAN.

CPAN Motivation

As you might guess, the rate of new Perl archives, and separate, distinct locations (we didn't have URLs back then) for a given work, grew rapidly. It became difficult to keep track of where this or that tool or script was located, and whether it was of any use. The most important tools which made it to the comp.sources newsgroups were generally well maintained, and available at multiple locations, but other things were quite unique. Some archives specialized in database access tools, others in documentation, and others in source code for Perl and the various ports. A unification was necessary, in order to make it simpler and more intuitive for the average newbie Perl user to get what he/she needed to implement his/her task, without reinventing the wheel.

So, due primarily to the efforts of a few tireless "Perl Packrats," including Jarkko Hietaniemi of Finland, the process of mirroring all of the existing hierarchies into a single hierarchy was set into place.

Nowadays, the CPAN is much more than simply a collection of scripts, documents, source, and miscellaneous tools and packages. It's become the de facto location for all Perl modules, and extensions, ports, patches, source code, and every other thing. There is also a dynamic, ongoing process attempting to make it easy to navigate, and relatively easy to contribute to, if you ever wish to make something you've written available on the Net.

The most important thing that the CPAN gives us is the ability to re-use code, and save effort. This lends to one of the true and fine qualities of any good Perl programmer: laziness. :-) We encourage you to explore the CPAN, and make use of it often.