CPAN Clients
Most people install their modules with a client.[184] There are three popular CPAN clients, each designed to appeal to different audiences with different needs. You don’t have to use the same one all the time or make a lifelong choice.
cpan
The cpan command, which comes with the Standard Library and the CPAN.pm module,
provides a quick way to install modules. Just specify the modules you
want on the command line:
% cpan IO::Interactive AnyEventTo install the modules in a different directory, you can
configure that. With no arguments, cpan drops you into the CPAN.pm shell:
% cpan
cpan> o conf makepl_arg INSTALL_BASE=/some/other/directory
cpan> o conf mbuild_arg "––install_base /some/other/directory"
cpan> o conf commitYou can also start the CPAN.pm shell:
% perl –MCPAN –e shell
cpan> install POEor use it with local::lib:
% perl –MCPAN –Mlocal::lib –e shell
cpan> install Set::CrossProductcpanp
Perl also comes with another CPAN interface, CPANPLUS. This project wanted to take the lessons from the
development of CPAN.pm and start
over:
% cpanp –i IO::Interactive AnyEventYou can also start the CPANPLUS shell:
% perl –MCPANPLUS –e shellCPAN Terminal>install POE
CPANPLUS uses a menu-driven
configuration system, so once you enter its shell, just follow its
prompts.
cpanminus
A third popular client that you might like if you like its defaults is
cpanminus, or just cpanm. This is a minimal client that strives
to do the right thing for most people. It also uses local::lib by default. Most ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access