Skip navigation.
Home
Your source for Perl tips, howto's, faq and tutorials
( categories: )

There are basically 2 methods to install a module from CPAN: manual and automatic (using the CPAN module).

Which method to use depend of the situation; using the automatic method is easier but assumes you are connected to the Internet; another advantage of using the CPAN shell is that it tries to resolve potential module dependency problems automatically (if you use the manual method, you have to manually resolve this issues). On the other hand, if you already have downloaded the perl module and/or you don't have Internet access, then the manual method could be the way to go.

-- Manual installation

1. Download the tarball file from www.cpan.org to your computer

2. Decompress and unpack the tarball file:

gzip -dc file.tar.gz | tar xvf -

3. Go into the folder that was created by the previous command

4. Build the module executing the following commands:

perl Makefile.PL
make
make test

5. If everything went well so far, install the module:

make install

-- Automatic installation using the CPAN module

Execute the following command:

perl -MCPAN -e 'install module'

where 'module' is the name of the module you want to install

Example:

perl -MCPAN -e 'install WWW::Extractor'