The main distribution point for Perl is the
Comprehensive Perl Archive
, or CPAN.
This archive contains not only the source code, but also just about
everything you could ever want that's Perl-related. CPAN is mirrored by
dozens of sites all over the world, as well as a few down under. The
main site is
(188.8.131.52). You can find a more local
CPAN site by getting the file
. Or you can use your Web browser to access the CPAN
multiplex service at
. Whenever you ask this Web
server for a file starting with
, it connects you to a CPAN
site, which it chooses by looking at your domain name. Here are some
popular universal resource locators (URLs) out of CPAN:
The CPAN multiplex service tries to connect you to a local, fast machine
on a large bandwidth hub. This doesn't always work, however, because
domain names may not reflect network connections. For example, you might
have a hostname ending in
but you may actually be better connected to
North America than to Sweden. If so, you can use the following URL to
choose your own site:
Note the absence of a slash at the end of the URL. When you omit the
trailing slash, the CPAN multiplexer presents a menu of CPAN mirrors from
which you can select a site. It will remember your choice next time.
The following machines should have the Perl source code plus a copy of the
CPAN mirror list - both available for anonymous FTP. (Try to use the
machine names rather than the numbers, since the numbers may change.)
The location of the top directory of the CPAN mirror differs on
these machines, so look around once you get there. It's often
Under the main CPAN directory, you'll see at least the following
. This directory contains numerous subdirectories, one for each contributor
of software. For example, if you wanted to find Lincoln Stein's great
CGI module, and you knew for a fact that he wrote it, you could look in
. If you didn't know he wrote it, you could
look in the
directory explained below.
. A directory containing all manner of Perl documentation. This includes
all official documentation (manpages) in several formats (such as
ASCII text, HTML, PostScript, and Perl's native POD
format), plus the FAQs and interesting supplementary documents.
. This directory contains unbundled modules written in C, Perl, or both. Extensions allow you to
emulate or access the functionality of other software, such as Tk graphical
facilities, the UNIX curses library, and math libraries. They also give
you a way to interact with databases (Oracle, Sybase, etc.), and to manage HTML
files and CGI scripts.
. This directory contains the source code and/or binaries for Perl ports to
operating systems not directly supported in the standard distribution.
These ports are the individual efforts of
their respective authors, and may not all function precisely as
described in this book. For example, none of the MS-DOS ports
function, for some reason.
. A collection of diverse scripts from all over the world. If you need to
find out how to do something, or if you just want to see how other people
write programs, check this out.
contains the examples from this
book. (You can also find these sources at the O'Reilly & Associates
. Within this directory you will find the source for the standard Perl
distribution. The current production release is always in the file
that is called
which as of this writing is a symbolic link to the file
, but will likely point to a higher
version number by the time you read this. This very large file contains
full source and documentation for Perl. Configuration and installation
should be relatively straightforward on UNIX and UNIX-like systems, as
well as VMS and OS/2.
In the event you've never used anonymous FTP, here is a quick
primer in the form of a sample session with comments.
Text in bold typewriter font is what you should type; comments are in
represents your prompt, and should not be typed.
(ftp.CPAN.org is not a real site)
Connected to ftp.CPAN.org.
220 CPAN FTP server (Version wu-2.4(1) Fri Dec 1 00:00:00 EST 1995) ready.
331 Guest login ok, send your complete e-mail address as password.
(Use your user name and host here.)
230 Guest login ok, access restrictions apply.
250 CWD command successful.
You must specify binary transfer for compressed files.
200 Type set to I.
200 PORT command successful.
150 Opening BINARY mode data connection for FILE.
226 Transfer complete.
repeat this step for each file you want
Once you have the files, first unzip and untar them, and then
configure, build, and install Perl:
gunzip < latest.tar.gz | tar xvf -
(Use actual directory name.)
Now either one of these next two lines:
(Lowercase "c" for automatic configuration)
(Capital "C" for manual configuration)
(Build all of Perl.)
(Make sure it works.)
(You should be the superuser for this.)
For retrieving and building unbundled Perl modules, the process is
slightly different. Let's say you want to build and install a module
named CoolMod. You'd first fetch it via
(1), or you could use
your Web browser to access the module service from
always retrieves the most up-to-date version of a particular
registered module. The address to feed your browser would be something
Once you've gotten the file, do this:
gunzip < CoolMod-2.34.tar.gz | tar xvf -
(Creates the real Makefile
(Build the whole module.)
(Make sure it works.)
(Probably should be the superuser)
When the CoolMod module has been successfully installed (it will be
automatically placed in your system's Perl library path), your programs
, and you should be able to run
) to read the