Which cpan installer is correct? (CPAN.pm/CPANPLUS/cpanminus)

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

What is the difference between the three?

What situations require the use of one over the other?

Are there any other module installers I should be aware of?

+57
perl cpan
May 02 '11 at 19:05
source share
4 answers

CPAN.pm ( cpan ) is the original client. It comes with Perl, so you already have it. It has most of the features. It has many configuration options to customize the way it works.

Its biggest limitation is its configuration. Although recent versions improved it, he often asked a lot of questions before you could start installing the modules. People not familiar with Perl may not know the correct answers.




cpanminus ( cpanm ) - an attempt to make a client with zero configuration, which automatically does the right thing for most users. It is also designed to work on systems with limited resources (for example, easy to install . It easily integrates with local :: lib .

Its biggest limitation is the 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 the application that you use from the command line. The cpanp shell is more of a proof of concept, and I don't know any real benefits of using it.




In general, I would recommend either cpan or cpanm . If you are having trouble configuring cpan , try cpanm . If your situation is unusual, try cpan .

+68
May 2 '11 at 21:11
source share

It is impossible to answer this question because it is too subjective. :)

From my point of view: cpanm is the easiest way to install perl modules. You can install cpanm with:

 curl -L http://cpanmin.us | perl - --sudo App::cpanminus 

and after that you can install the modules with a simple:

 cpanm Some::Module 

You can use cpanm to mirror (part of) CPAN for your local computer, so IMHO cpanm is best for the most common CPAN needs.

+12
May 2 '11 at 20:23
source share

Are there other module installers I should know?

If you are using a Linux distribution for CPAN module packages, you should use your package installer to install the modules. For example, Ubuntu / Debian has a huge number of CPAN modules that you can install with apt, and Red Hat / Centos / Fedora has a number that you can install with yum.

+6
May 03 '11 at 6:04 am
source share

CPAN is the standard. cpanminus (cpanm) asks less questions (best in most cases). I do not know anyone who uses cpanplus.

As these modules do, it downloads, compiles and installs (placing files in the right places), all of them must perform the same task. Some difference relates to the level of permissions that you have. Perhaps you want to install some local things for your user and some things all over the world, then you need more fine-tuning. Developers may also need to control / interrupt the process for debugging, etc.

Use cpanm for daily use, if you're not too lazy to install it, then CPAN is fine.

+3
May 02 '11 at 19:18
source share



All Articles