Perl modules

Introduction to Perl modules

The Perl module packages add useful objects to the Perl language. Modules utilized by packages throughout BLFS are listed here, along with their dependencies. Most references to Perl modules are in the form of Module, Module::SubName or Module::Sub::Name, however occasionally you'll also see Module, Module-SubName or Module-Sub-Name. Most references on this page are in the latter form, as these are the official package names.

The Module::Info module

One module in particular is shown first, as this module's usefulness warrants installation, even though it won't be required by many other modules. The Module::Info module can tell you if a particular module is included in, or has been installed into your Perl installation. Additionally, the module can tell you what versions are installed and what dependencies are required for them. You can even use Module::Info to gather dependencies of uninstalled modules.

Installation of Perl modules

Install Perl modules by running the following commands:

perl Makefile.PL &&
make &&
make test

Now, as the root user:

make install

The modules listed below require modifications to the instructions in order to install successfully.

Gtk-Perl-0.7009:

perl Makefile.PL --without-guessing &&
make &&
make test

Now, as the root user:

make install

SGMLSpm-1.03ii

If your system's Perl version is different than 5.8.5, you'll need to modify the sed command below to reflect the version you have installed.

sed -i -e "s@/usr/local/bin@/usr/bin@" \
       -e "s@/usr/local/lib/perl5@/usr/lib/perl5/site_perl/5.8.5@" \
       -e "s@/usr/local/lib/www/docs@/usr/share/doc/perl5@" \
    Makefile

Now, as the root user:

make install &&
install -v -d -m755 /usr/share/doc/perl5 &&
make install_html &&
rm -v -f /usr/share/doc/perl5/SGMLSpm/sample.pl &&
install -v -m644 DOC/sample.pl /usr/share/doc/perl5/SGMLSpm

(Alternate) Auto installation of Perl modules.

There is an alternate way of installing the modules using Perl's built-in install command. The command automatically downloads the source from the CPAN archive, extracts it, runs the commands mentioned above, and removes the build tree. You may still need to install dependent library packages before running the automated installation method.

The first time you run this command, you'll be prompted to enter some information regarding download locations and methods. This information is retained in files located in ~/.cpan. Start the perl shell with the following command as the root user:

perl -MCPAN -e shell

Each module may now be installed from this shell with the command:

install [Module::Name]

For additional commands and help, type help.

Last updated on 2005-02-08 19:52:39 -0700