William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

Perl: install CPAN module

While setup a new app env in Linux, I need to install some perl modules, such as excellent WWW::Mechanize.pm. Normally using CPAN module to do the installation:

# perl -MCPAN -e shell
cpan> install WWW::Mechanize

However, in many cases the installation has some problems, due to system environment, such as:

Failed 1/54 test programs. 0/569 subtests failed.
make: *** [test_dynamic] Error 255
/usr/bin/make test — NOT OK
Running make install
make test had returned bad status, won’t install without force

The test is strict, in many case it fails. Test failure doesn’t mean the module can’t be installed. Installation can continue without any problem.
After the failure, to skip the testing, my way is like this:

# cd $HOME/.cpan/
# cd /build/WWW-Mechanize-1.68/
# make install

It should work. to verify the module is installed successfully, use:

$ perldoc WWW::Mechanize

to check out its documents. If the man-page can be accessible, means the installation is successful.

A tip is suppose we want to install many perl modules at the same time, don’t need ‘perl -MCPAN -e shell’ to install 1 by 1.
Create a file, put all the perl modules inside, and fetch from the files instead of command-line; if any issue, go directly to /root/.cpan/ to modify.
This is the most quick and simple solution.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: