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. Installation of the modules shown on this page should be accomplished by installing the listed dependencies (from the bottom and working up to the top) and then the desired module. Most references to Perl modules are in the form of Module, Module::SubName or Module::Sub::Name, though sometimes you'll see Module, Module-SubName or Module-Sub-Name. The references on this page that reflect an external URL are in the latter form, as these are the official package names.

[Note]

Note

Some dependencies, such as the Test::Pod-1.24 module, are used by several of the listed dependencies of the main module and perhaps also the module being installed. Dependencies such as this are only listed once in the dependency chain for each main module (typically near the bottom-most dependency) to avoid redundancy and additional clutter in the instructions.

Archive::Zip-1.16

The Archive::Zip module allows a Perl program to create, manipulate, read, and write Zip archive files. The modules listed below are installed using the standard Perl module build and installation instructions.

Compress::Zlib-1.41

The Compress::Zlib module provides a Perl interface to the Zlib compression library. Most of the functionality provided by Zlib is available in Compress::Zlib. The module can be split into two general areas of functionality, namely in-memory compression/decompression and read/write access to gzip files.

[Note]

Note

The Compress::Zlib module requires the following sed after untarring the distribution tarball (before any other build commands) to use the system-installed copy of Zlib.

sed -i -e "s|BUILD_ZLIB = True|BUILD_ZLIB = False|" \
       -e "s|INCLUDE    = ./zlib-src|INCLUDE    = /usr/include|" \
       -e "s|LIB        = ./zlib-src|LIB        = /usr/lib|" \
    config.in

Date::Manip-5.44

Date::Manip is a set of routines designed to make any common date/time manipulation easy to do. Operations such as comparing two times, calculating a time a given amount of time from another, or parsing international times are all easily done. From the very beginning, the main focus of Date::Manip has been to be able to do ANY desired date/time operation easily.

Finance::Quote-1.11

Finance::Quote is used to get stock quotes from various Internet sources, including Yahoo! Finance, Fidelity Investments, and the Australian Stock Exchange. There are two methods of using this module – a functional interface that is depreciated, and an object-orientated method that provides greater flexibility and stability. With the exception of straight currency exchange rates, all information is returned as a two-dimensional hash (or a reference to such a hash, if called in a scalar context).

After you've installed the package, issue perldoc Finance::Quote for full information. Alternatively, you can issue perldoc lib/Finance/Quote.pm after unpacking the distribution tarball and changing into the top-level directory. The module and dependencies are installed using the standard Perl module build and installation instructions.

[Note]

Note

To run the regression test suite, you'll need a working Internet connection and then create a symbolic link to the test directory using the following command after unpacking the tarball and changing into the root directory of the source tree:

ln -s test t

Some tests will fail depending on certain conditions. See the INSTALL file for full details.

Finance::QuoteHist-1.07

The Finance::QuoteHist bundle is several modules designed to fetch historical stock quotes from the web. The module and dependencies are installed using the standard Perl module build and installation instructions.

HTML::Parser-3.54

The HTML::Parser distribution is a collection of modules that parse and extract information from HTML documents. The modules listed below are installed using the standard Perl module build and installation instructions.

HTML::TableExtract-2.07

HTML::TableExtract is a module that simplifies the extraction of the content contained in tables within HTML documents, extracted either as text or encoded element trees. Tables of note may be specified using Headers, Depth, Count, Attributes, or some combination of the four. The module and dependencies are installed using the standard Perl module build and installation instructions.

libwww-perl-5.805 (a.k.a. LWP)

The libwww-perl (LWP) collection is a set of Perl modules which provide a simple and consistent application programming interface to the World-Wide Web. The main focus of the library is to provide classes and functions that allow you to write WWW clients. The library also contains modules that are of more general use and even classes that help you implement simple HTTP servers. The LWP collection and all its Perl module dependencies are installed using the standard Perl module build and installation instructions.

[Note]

Note

Newer versions of OpenSSL expose a bug in the Crypt::SSLeay sources. Issue the following sed command (after unpacking the Crypt::SSLeay tarball and changing directories into the root of the source tree) to fix the problem:

sed -i '/algorithms/ a\               SSL_library_init();' SSLeay.xs

Module::Build-0.2801

The Module::Build module is a system for building, testing, and installing Perl modules. It is meant to be an alternative to ExtUtils::MakeMaker. Developers may alter the behavior of the module through subclassing in a much more straightforward way than with MakeMaker. It also does not require a make command on your system. Most of the Module::Build code is pure-Perl and written in a very cross-platform way.

The Module::Build module (as well as any other Perl module that uses the Module::Build build system) uses modified build instructions. All the dependencies are installed using the standard Perl module build and installation instructions.

Module::Build Build and Installation Instructions

perl Build.PL &&
./Build &&
./Build test

Now, as the root user:

./Build install

Module::Info-0.30

The Module::Info module is quite useful for tasks other than just support of other modules. It can be used from the command-line to tell you if a particular module is included in, or has been installed into your Perl installation. Additionally, Module::Info can tell you what version of a module is installed and what dependencies are required for it. You can even use Module::Info to gather dependencies of uninstalled modules. The Module::Info module installs using the standard Perl module build and installation instructions. The version module requires using the Module::Build modified build instructions.

Module::Signature-0.54

The Module::Signature module is used to check and create SIGNATURE files for CPAN distributions. After installing Module::Signature you can verify the content of a distribution tarball (if it includes a SIGNATURE file) by unpacking the tarball, changing into the newly created directory and issuing the command cpansign -v. It will check each file's integrity, as well as the signature's validity. Note that some of the dependencies appear to be circular, however, they are only run-time conflicts and you should be able to fully utilize them as long as everything is installed. Module::Signature and the dependency modules are installed using the standard Perl module build and installation instructions.

Net::DNS-0.57

Net::DNS is a DNS resolver implemented in Perl. It can be used to perform nearly any type of DNS query from a Perl script. The Net::DNS module and all its dependencies are installed using the standard Perl module build and installation instructions.

SGMLSpm-1.03ii

The SGMLSpm module is a Perl library used for parsing the output from James Clark's SGMLS and NSGMLS parsers. This module requires modified installation instructions, shown below.

If your system's Perl version is different than 5.8.8, 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.8@" \
       -e "s@/usr/local/lib/www/docs@/usr/share/doc/perl5@" \
    Makefile

Now, as the root user:

make install &&
install -v -m755 -d /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

Test::Pod-1.24

The Test:Pod module is (most of the time, optionally) used by other modules during the build process to check the validity of POD (Plain Old Documentation) files. The Test::Pod module is typically included by module authors to automatically find and check all POD files in a module distribution. This module and all the dependencies are installed using the standard Perl module build and installation instructions.

Test::Pod::Coverage-1.08

The Test::Pod::Coverage module is used to check files in a distribution for POD coverage. It is normally used by developers to ensure their projects are adequately covered with POD and it is also used in the test suites of many module distributions. The Pod::Coverage module can use the Module::Build modified build instructions, all the other modules are installed using the standard Perl module build and installation instructions.

Test::Simple-0.62

The Test::Simple module contains utilities designed to assist developers in creating tests. A version of Test::Simple was installed during LFS with the Perl-5.8.8 installation, however, some of the sub-modules contained in Test::Simple have been updated (notably, the Test::More module) and these updated modules are now required by other modules. This updated version of Test::Simple also now includes the Test:Builder:Tester module, required by many of the modules on this page. Note that installing this updated version of Test::Simple will overwrite some files from the original Perl installation, but there's really nothing to be alarmed about as these modules are only used by developers creating tests, or for running the test suites during additional module installations.

Text::Diff-0.35

Text::Diff is used to perform diffs on files and record sets. It provides a basic set of services akin to the GNU diff utility. It is not anywhere near as feature complete as GNU diff, but it is better integrated with Perl and available on all platforms. Text::Diff is often faster than shelling out to a system's diff executable for small files, and generally slower on larger files. The modules listed below are installed using the standard Perl module build and installation instructions.

Tk-804.027

The Tk module is a Perl interface to the Tk package. The goal of this release is Unicode support via Perl's and core-Tk's use of UTF-8. Tk-804.027 builds and loads into a threaded Perl but is NOT yet thread safe. The module is installed using the standard Perl module build and installation instructions.

XML::Parser-2.34

The XML::Parser module is a Perl extension interface to James Clark's XML parser, expat. The module is installed using the standard Perl module build and installation instructions.

YAML-0.58

The YAML modules implement a YAML Loader and Dumper based on the YAML 1.0 specification http://www.yaml.org/spec/. YAML is a generic data serialization language that is optimized for human readability. It can be used to express the data structures of most modern programming languages.

[Note]

Note

The YAML, Test::Base and Spiffy modules will install UTF-8 encoded manual pages. To modify the manual pages so that non-UTF-8 encoded pages are installed, issue the following commands (before any other build commands):

For Spiffy:     sed -i 's,\xc3\xb6,o,' lib/Spiffy.pm

For Test::Base: sed -i 's,\xc3\xb6,o,' \
                  lib/Test/Base{,/Filter}.pm \
                  lib/Module/Install/TestBase.pm

For YAML:       sed -i 's,\xc3\xb6,o,' \
                  ysh \
                  lib{,/Test}/YAML.pm \
                  lib/YAML/{Types,Node,Error,Marshall,Tag,Base}.pm \
                  lib/YAML/{Loader,Dumper}{,/Base}.pm

Standard 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

(Alternate) Auto Installation of Perl Modules.

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

The first time you run cpan, you'll be prompted to enter some information regarding download locations and methods. This information is retained in files located in ~/.cpan. Start the cpan shell by issuing 'cpan' as the root user. Any module may now be installed from the cpan>  prompt with the command:

install <Module::Name>

For additional commands and help, issue 'help' from the cpan>  prompt.

Alternatively, for scripted or non-interactive installations, use the following syntax as the root user to install one or more modules:

cpan -i <Module1::Name> <Module2::Name>

Review the cpan.1 man page for additional parameters you can pass to cpan on the command line.

Last updated on 2007-01-30 14:24:11 -0600