Perl Installation Hints and Tips

Download the latest CPAN packages from http://www.cpan.org/ by searching CPAN for Bundle::CPAN

  • In the results list, click on the link which includes that version number, at the bottom of the brief description.
  • Then click on the download link next to 'This Release' at the top of the page.
  • Install the CPAN bundle using the following general instructions.

Instructions for installing CPAN packages should be available at http://search.cpan.org/author/JHI/perl-5.8.0/pod/perlmodinstall.pod, but basically is as follows:

  • su to root
  • untar the downloaded package to a temporary working area
  • Change to the newly created package directory
  • perl Makefile/PL
    • or (To stop prompts during the installation process...)
  • perl Makefile/PL -n
  • make
  • make test
  • make install

If the tests fail, it's probably because there's a package dependency. To find out what dependencies there are, refer to the README for the package.

  • less ~/tmp/build/PACKAGE_NAME/README
  • less ~/.cpan/build/PACKAGE_NAME/README

Once you've got the CPAN module installed, you can install other modules directly from CPAN with:

  • perl -MCPAN -e 'install "BUNDLE::NAME"'

See above for dealing with any failed tests.

To quickly check whether a package is already installed:

  • pearl -MMyPerl -e 1

If no error message, then it's installed.

Misc

It seems easiest to install bundles. This seems to handle dependencies very well. Search CPAN for the package name as Bundel::PACKAGE::NAME

If you get any problems installing using the CPAN module, try downloading and building it manually. There may be dependencies on other non-perl packages.

@INC

Show what @INC is currently set to

  • perl -V

or

  • perl -e 'print join "\n", @INC'

@INC is set at perl compile time but can be changed by altering the PERL5LIB environment label. It can also be changed at runtime with Perl array commands.

Run the following command to confirm whether a module is found on the @INC path or not:

  • perl -e 'use Foo:Bar;'

If there is not error output the module was found on the path.

Ref: http://alvinalexander.com/blog/post/perl/checking-testing-perl-module-in-inc-include-path

-- Frank Dean - 29 Jun 2017


-- Frank Dean - 30 Apr 2003