Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to install CPAN modules

📅 2013-Aug-11 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cpan, cpanminus, installation, module ⬩ 📚 Archive

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

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email