How to install CPAN modules

CPAN hosts thousands of Perl modules that can be installed easily on your computer. The traditional method to install a module named foo::bar is by using the cpan command:

$ cpan foo::bar

However, the tool asks you to answer quite a few questions to go through with the module installation.

A highly recommended improvement to CPAN module installation is to use cpanminus.

The easiest way to install it is from your distribution package:

$ sudo apt install cpanminus

You can also install it directly from CPAN:

$ cpan App::cpanminus

After this, you can install any CPAN module by calling cpanm:

$ cpanm foo::bar

The advantage of using cpanminus is that it takes care of automating the module installation process as much as possible for you.

Tried with: CPAN 1.61 and Ubuntu 16.04

Advertisements

One thought on “How to install CPAN modules

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.