Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between cpan and cpanm? [duplicate]

Tags:

perl

cpanm

cpan

What is the difference between the cpan and cpanm commands?

They both seem to install perl modules, so what is the difference?

like image 445
CJ7 Avatar asked Jul 08 '16 01:07

CJ7


People also ask

What is the use of CPAN?

CPAN's main purpose is to help programmers locate modules and programs not included in the Perl standard distribution. Its structure is decentralized. Authors maintain and improve their own modules. Forking, and creating competing modules for the same task or purpose, is common.

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 CPAN shell?

DESCRIPTION. The CPAN module automates or at least simplifies the make and install of perl modules and extensions. It includes some primitive searching capabilities and knows how to use LWP, HTTP::Tiny, Net::FTP and certain external download clients to fetch distributions from the net.


1 Answers

cpan the CPAN shell has been shipped with Perl since about 1997. When you run it the first time it asks a bunch of questions and saves the answers in a config file. Then you can install a module by running:

cpan -i Module::Name 

The shell provides other commands for searching CPAN and looking inside distribution files.

A project to create a newer, better and more featureful CPAN shell called CPANPLUS (cpanp from the command-line) was started by Jos Boumans, but it was never quite completed to the point where the original vision had been realised.

Meanwhile MIYAGAWA decided that cpanp was trying to do too much and what the world really needed was a simpler shell that did less and asked fewer questions (ideally none at all). He created App::cpanminus which provides the cpanm command and does exactly what he intended. You can use it to install a module (and all the module's dependencies) with a command like:

cpanm Module::Name 

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.

like image 126
Grant McLean Avatar answered Nov 12 '22 00:11

Grant McLean