Perl Admin

Installing Modules

CPAN shell (Solaris and Red Hat systems)

lethe {/tmp} > sudo /util/bin/perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support enabled

cpan> install HTML::LinkExtor
CPAN: Storable loaded ok
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
Going to read /tmp/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Fetching with LWP:
Going to read /tmp/.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Mon, 25 Jun 2007 11:08:50 GMT

  There's a new version (v1.9102) available!
  [Current version is v1.7601]
  You might want to try
    install Bundle::CPAN
    reload cpan
  without quitting the current session. It should be a seamless upgrade
  while we are running...

Fetching with LWP:
Going to read /tmp/.cpan/sources/modules/
Going to write /tmp/.cpan/Metadata
HTML::LinkExtor is up to date.

Module Tweaking

Some modules require specific config options. DBD::mysql is a good example: Get, but don't install, the module using the CPAN method.

  1. Using CPAN, get (but don't install) the module:
    cpan> get DBD::mysql
  2. Escape to a shell to build the Makefile manually: /util/bin/perl Makefile.PL --libs="-L/util/lib/mysql -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm -L/util/gnu/lib -lgcc_s" --cflags=-I/util/include/mysql --testdb=test --testuser=root --testpassword=sekrit
  3. Return to CPAN to finish the installation:
    cpan> install DBD::mysql

Ports (FreeBSD Systems)

I think I've mentioned this before but please don't use bsdpan stuff to install things on FreeBSD machines that can be installed via ports. They're almost guaranteed to break the next time I do a ports update sweep.

The algorithm for installing something like this is :

        cd /usr/ports
        ls -d */*CGI-Session*

If that doesn't bring up anything interesting checking things like www/p5-* or, worst case, */p5-* and visually filtering through everything that comes up will give you leads on what to install. In this case what's above gives:

cheshire 2 % cd /usr/ports
cheshire 3 % ls -d */*CGI-Session*
cheshire 4 % 

At that point, cd into www/p5-CGI-Session and do :

# make install clean

Please pkg_delete bsdpan-CGI-Session-4.20 and install from the ports. It makes keeping cheshire up to date down the road MUCH MUCH easier and less error prone. Using portupgrade(8) just plain works. Thanks.


  1. See for source config values.