Finding and Installing Perl Modules

Perl modules are available from the Comprehensive Perl Archive Network (CPAN). The CPAN is hosted at ftp.funet.fi but is mirrored to local sites all over the world. The file ftp://ftp.funet.fi/pub/languages/perl/CPAN/MIRRORS includes a list of mirror sites, so you can find one nearest to you.

Perl’s home web site at www.perl.com is also a good CPAN starting point. This site has a redirection facility that parses your domain name when you access a URL that includes the string “/CPAN/” and redirects you to a CPAN mirror in your network neighborhood.

The CPAN holds more than just Perl modules; it also holds Perl itself, in both source and binary form for multiple platforms.

Subdirectories under the CPAN include Perl modules listed by author, subject, and module name. The modules described in this chapter may be located in any of those ways, since the authors, subjects, and names are all provided.

Once you have downloaded the modules, unpack the archives in a temporary directory by issuing commands like this:

gzip -d [modulename].tar.gz; tar xvf [modulename].tar

If you use GNU tar, you can combine these into one step by using this syntax:

tar zxvf [modulename].tar.gz

A new directory will be created underneath the current one with the module name and version number (e.g., MIME-Base64-2.05). Change into that directory, and run the following to check the module’s dependencies, compile any necessary parts, test its integrity, and install it.

perl Makefile.PL ; make ; make test ; make install

Of course, you will need to have the make utility installed on your system (and a C compiler if the module has parts that require local compilation). You will also need permission to install the module (the last step). On some systems, you may need to be superuser (root) in order to install Perl modules.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.81.240