Perl - 18 - Installing and Using Perl Modules
Perl - 18 - Installing and Using Perl Modules
Contents
CPAN
Using Modules
Installing a Perl Module
Unpacking the Module Source
The Configuration Step
The Build Step
The Test Step
The Install Step
Using CPAN.pm
Using Module Documentation
1
Objectives
In this session we will learn how to
2
Unpacking Module Source
Tounpack the module source use the gunzip and tar
commands.
gunzip Some-Module-4.54.tar.gz
tar xf Some-Module-4.54
3
Build, Test & Install - Sample
A sample run showing the installation of MD5 module:
$
$ # Change over to the unpacked module source
$ cd MD5-1.7
$
$ # Build Step-1
$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for MD5
4
Build, Test & Install - Sample
A sample run showing the installation of MD5 module:
$ # Test Step
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch
-I./blib/lib
-I/usr/local/lib/perl5/i386-freebsd/5.00404 -
I/usr/local/lib/perl5 test.pl
1..14
ok 1
ok 2
...
ok 13
ok 14
5
Alternate Installation Directory
You can specify alternate installation directory while
building the module.
perl MakeFile.PL LIB=~/mylib
Recall
: You know how to access the modules available
any where in the file system.
6
Using Module Documentation
Look into the module documentation for more
information on a specific module.
Use the perldoc utility to view module documentation
$
$ perldoc DBI
$