Perl Install Notes

This document contains notes on installing Perl on a Linux platform.

Installing The Perl Interpreter on Linux

Download the latest Perl source tar file from http://ftp.funet.fi/pub/CPAN/src/. Make sure you get the source files for a stable release (the last digit in the release number will be even, e.g. 5.8.8). Untar the tar file in the top level source directory (e.g. /rpm/perl):

     tar -xvzf perl-m.n.xx.tar.gz

The tar command will create a new directory for the m.n.xx version of Perl. Switch to that directory and begin configuring Perl:

     sh Configure

Or, if you are starting over with a preexisting build, restart the configuration process by doing:

     rm -f config.sh Policy.sh
     sh Configure

The configuration script will ask you a lot of questions. Many of them are about where it should put things. Here are some hints:

     Top-level directory: /usr/lib/perl5/m.n.xx
     Site directory: /usr/lib/perl5/site_perl/m.n.xx
     Vendor directory: /usr/lib/perl5/vendor_perl/m.n.xx
     HTML docs: /usr/share/doc/perl-m.n.xx
     Manuals (mistakenly called POD source): /usr/share/man
     Binaries and scripts: /usr/bin

You may have to hack the generated config.sh at the end of the configuration process to make sure that it is correct. Despite my picking path names like these during configuration, it still got them wrong. Couldn't hurt to check.

Once configure is done, make and test the Perl interpreter:

     make
     make test

If all the tests are passed, switch to super-duper user and install Perl:

     su
     make install

If you'll want to use the Perl documentation from a Web browser, you need to build the HTML files from the POD files. Note that this step does not read the destination directories from the config file, despite they're being in there:

     ./installhtml --podroot=. --podpath=lib:ext:pod:vms --recurse
          --htmldir=/usr/share/doc/perl-m.n.xx --htmlroot=/doc/perl-m.n.xx
          --splithead=pod/perlipc --splititem=pod/perlfunc
          --libpods=perlfunc:perlguts:perlvar:perlrun:perlop --verbose

This command assumes that you have an HTML directory named /doc that actually points to /usr/share/doc. If your httpd.conf file has some other definition for the /doc directory, you'll need to use that instead.

CPAN Modules

If you have an active Internet connection, you can install/upgrade the various add-on modules that you want directly from CPAN. As root, do the following:

     perl -MCPAN -e shell

The first time you run CPAN after a new Perl build, you'll need to set it up manually. Here are the answers to some of the questions (if you don't see your favorite question here, its pretty safe to take the default):

     CPAN build and cache directory? /root/.cpan
     Cache size for build directory (in MB)? 100
     Perform cache scanning (atstart or never)? atstart
     Policy on building prerequisites (follow, ask or ignore)? ask
     Pretty good mirror sites (for USA)?
          http://cpan.mirror.facebook.net/
          http://mirrors.ibiblio.org/CPAN/
          http://www.perl.com/CPAN/

To list the mirror sites that you are currently using (i.e. when you need to replace one because it has gone mams aloft):

To remove an offending mirror from the beginning of the list:

To remove an offending mirror from the end of the list:

To add a new mirror to the beginning of the list:

To add a new mirror to the end of the list:

When all of your changes are completed, save them with:

Here are some bundles that you are likely to want:

     install Bundle::CPAN
     install Compress::Zlib
     install IO::Zlib
     install Digest::SHA1
     install HTML::Parser
     install Net::DNS
     install Net::Ident
     install Time::HiRes
     install DB_File
     install Bundle::DBI
     install Tie::IxHash

For Spamassassin, you'll need these additional modules:

     install Mail::SPF
     install Mail::DKIM
     install IP::Country
     install Archive::Tar

For the Informix database, you'll need this additional module:

     install Bundle::DBD::Informix