• Blogs (9)
    • đŸ“± 236 - 992 - 3846

      📧 jxjwilliam@gmail.com

    • Version: ‍🚀 1.1.0
  • Perl: install CPAN module

    Blogs20112011-05-28


    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.