Tuesday 18 June 2013

Checking if a perl module is installed, and installing a perl module locally

Checking a perl module is installed
To check if a perl module is installed, for example, the Test::Simple module, you can type:
% perl -MTest::Simple -e 1
If there is no output, then it means the perl module is installed.

Finding out where a perl module is installed
To find out where a perl module, eg. Test::Simple, is installed, you can type:
% perldoc -l Test::Simple

To see the raw source of an installed perl module
To see the raw source of an installed perl module, eg. Test::Simple, type:
% perldoc Test::Simple

Installing a perl module locally
To install a perl module locally, eg. Carp::Assert, you can type:
% wget search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Carp-Assert-0.20.tar.gz
% gunzip Carp-Assert-0.20.tar.gz
% tar -xvf Carp-Assert-0.20.tar
% cd Carp-Assert-0.20
% perl Makefile.PL PREFIX=~alc/Documents/PerlModules/
% make test
% make install


No comments: