Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which cpan installer is the right one? (CPAN.pm/CPANPLUS/cpanminus)

Tags:

perl

cpan

There are multiple installers for cpan modules available; I know of at least CPAN.pm (comes with perl,) CPANPLUS, and cpanminus.

What is the difference between the three?

What situations call for using one over the other?

Are there other module installers I should know about?

like image 972
Sean McMillan Avatar asked May 02 '11 19:05

Sean McMillan


People also ask

What is CPAN PM?

CPAN.pm is a Perl module which allows to query and install modules from CPAN sites. It supports interactive mode invoked with cpan. or perl -MCPAN -e shell. Querying modules.

What is the difference between CPAN and Cpanm?

The main difference between the two is that if you have Perl you should already have the cpan command. Whereas you won't have cpanm unless/until you install it.

Where does CPAN install to?

CPAN doesn't actually install files. It runs the install script embedded in each distribution, which then performs the actual install. For distributions using ExtUtils::MakeMaker, the defaults are documented here: https://metacpan.org/pod/ExtUtils::MakeMaker#make-install (and the default value of INSTALLDIRS is site ).

What is the use of CPAN?

CPAN can denote either the archive network or the Perl program that acts as an interface to the network and as an automated software installer (somewhat like a package manager). Most software on CPAN is free and open source software.


1 Answers

CPAN.pm (cpan) is the original client. It comes with Perl, so you already have it. It has the most features. It has a lot of configuration options to customize the way it works, though virtually everyone accepts the default installation. It integrates easily with local::lib.


cpanminus (cpanm) is an attempt to make a zero-configuration client that automatically does the right thing for most users. It's also designed to run well on systems with limited resources (e.g. a VPS). It doesn't come with Perl, but it's easy to install. It integrates easily with local::lib.

Its biggest limitation is its lack of configuration. If you want to do something unusual, it may not support it.


CPANPLUS (cpanp) is an attempt to make a CPAN API that Perl programs can use, instead of an app that you use from the command line. The cpanp shell is more of a proof-of-concept, and I don't know of any real advantages to using it.


In summary, I'd recommend either cpan or cpanm. If you have trouble configuring cpan, try cpanm. If your situation is unusual, try cpan.

like image 103
cjm Avatar answered Sep 23 '22 08:09

cjm