CPAN

Perl Module Manager

Interact with CPAN from the command line
               # without arguments, starts CPAN.pm shell
               cpan

               # with arguments and no switches, installs specified modules
               cpan module_name [ module_name … ]

               # with switches, installs modules with extra behavior
               cpan [-cfFimtTw] module_name [ module_name … ]

               # use local::lib
               cpan -I module_name [ module_name … ]

               # one time mirror override for faster mirrors
               cpan -p …

               # with just the dot, install from the distribution in the current directory
               cpan .

               # without arguments, but some switches
               cpan [-ahpruvACDLOPX]
Command interface to CPAN. Options
-s Drop into the CPAN.pm shell.
-i module [ module … ] Install the specified modules. With no other switches, this switch is implied.
-l List all installed modules
-C module [ module … ] Show the Changes
-m module [ module … ]Make
-r compiles dynamically loaded modules with CPAN::Shell->recompile.
-t module [ module … ] make test
-O Show out-of-date
cpan -O >cpanoO
 6/21/24  twitcher.us (GoDaddy)
Argument "undef"   isn't numeric in printf at /usr/share/perl5/vendor_perl/App/Cpan.pm line 1355.
Argument "1.03_01" isn't numeric in printf at /usr/share/perl5/vendor_perl/App/Cpan.pm line 1355.
Argument "undef"   isn't numeric in printf at /usr/share/perl5/vendor_perl/App/Cpan.pm line 1355.

813 lines
Module Name                                Local    CPAN
-------------------------------------------------------------------------
Algorithm::Diff                           1.1903  1.2010
Alien::Base                               2.8000  2.8300
Alien::Base::PkgConfig                    2.8000  2.8300
…
App::Cpan                                 1.6600  1.6780
App::Prove                                3.4200  3.4800
…
CPAN                                      2.1800  2.3600
CPAN::Admin                               5.5000  5.5010
CPAN::Bundle                              5.5003  5.5005
CPAN::Distribution                        2.1800  2.3400
CPAN::FTP                                 5.5008  5.5016
CPAN::FirstTime                           5.5310  5.5317
CPAN::HTTP::Client                        1.9601  1.9602
CPAN::HandleConfig                        5.5008  5.5012
CPAN::Index                               2.1200  2.2900
CPAN::Meta::Requirements                  2.1400  2.1430
CPAN::Mirrors                             2.1200  2.2700
CPAN::Plugin                              0.9600  0.9700
CPAN::Plugin::Specfile                    0.0100  0.0200
CPAN::Queue                               5.5002  5.5003
CPAN::Shell                               5.5006  5.5009
CPAN::Tarzip                              5.5012  5.5013
Carp                                      1.4200  1.5000
…
Config::Perl::V                           0.3000  0.3600
Cwd                                       3.7400  3.7500
DB_File                                   1.8420  1.8590
…
Term::ANSIColor                           4.0600  5.0100
Term::Cap                                 1.1700  1.1800
Term::ReadKey                             2.3700  2.3800
Test2                                     1.3021  1.3022
…
-D module [ module … ] Show module detailsfor out-of-date module (locally installed with newer versions ). module name, local version, and CPAN version.
CPAN
-------------------------------------------------------------------------
    (no description)
    A/AN/ANDK/CPAN-2.36.tar.gz
    /usr/share/perl5/vendor_perl/CPAN.pm
    Installed: 2.18
    CPAN:      2.36  Not up to date
    Andreas J. Koenig (ANDK)
    andreas.koenig.7os6vvqr@franz.ak.mind.de

DBI
-------------------------------------------------------------------------
    (no description)
    T/TI/TIMB/DBI-1.643.tar.gz
    (no installation file)
    Installed: not installed
    CPAN:      1.643  Not up to date
    Tim Bunce (TIMB)
    Tim.Bunce@pobox.com

DBD:MariaDB
-------------------------------------------------------------------------
    (no description)
    P/PA/PALI/DBD-MariaDB-1.23.tar.gz
    (no installation file)
    Installed: not installed
    CPAN:      1.23  Not up to date
    Pali (PALI)
    pali@cpan.org

CGI
-------------------------------------------------------------------------
    (no description)
    L/LE/LEEJO/CGI-4.66.tar.gz
    (no installation file)
    Installed: not installed
    CPAN:      4.66  Not up to date
    Lee Johnson (LEEJO)
    lee@payprop.com
   
-f Force the specified action, when it normally would have failed. Used to install a module even if its tests fail. -i is not optional for installing a module.
 % cpan -f -i Module::Foo 
-F Don't lock activites, allowing multiple activities tom run at the same time. Danger
-g module [ module … ] Gets the latest distribution of the module to the current directory .
-G module [ module … ] UNIMPLEMENTED Get the latest distribution of the modulesi to the current directory , unpack each distribution, and create a git repository for each distribution.
-a Creates a CPAN.pm autobundle with CPAN::Shell->autobundle.
-I Load local::lib
-J Dump the configuration in the format that CPAN.pm uses.
Useful for checking the configuration as well as using the dump as a starting point for a new, custom configuration.
-j Config.pm Load configuration .
-T Do not test modules.
-u Upgrade all installed modules. Blindly doing this can really break things, so keep a backup.
-p Ping mirrors and output a report
-P Find the best mirrors and use them .
CPAN: LWP::UserAgent loaded ok (v6.34)
Fetching with LWP:
http://www.cpan.org//MIRRORED.BY
Searching for the best continent ...
Testing Global
    www.cpan.org -> 1.90 ms
    -->median time: 1.90 ms
Median result by continent:
     2 ms  Global
Scanning Global ...
Nothing to install!
-M mirror1,mirror2,… list of mirrors to use for this run.
-L author [ author … ] List the modules by the authors.
Can't locate object method "userid" via package "A1z::HTML5::Template" 
(perhaps you forgot to load "A1z::HTML5::Template"?) at /usr/share/perl5/vendor_perl/App/Cpan.pm line 137
-A module [ module … ] Show primary maintainers
pan -A DBI
…
DBI                       TIMB     Tim.Bunce@pobox.com       Tim Bunce
cpan -A DBD:mysql
…
DBD:mysql                 DVEEDEN  pause@myname.nl           Daniel van Eeden
-h Display help and exit.
-v Display the script and CPAN.pm versions then exit.
-V Display details about the client.
-n Do a dry run, but don't actually install anything. (unimplemented)
-w UNIMPLEMENTED Turn on cpan warnings. This checks various things, like directory permissions, and tells you about problems you might have.
-x module [ module … ] Find close matches to the named modules.
requires installation of Text::Levenshtein or Text::Levenshtein::Damerau.
-X Dump the namespaces

Examples

                # output a help message cpan -h

               # display the version numbers cpan -v

              # create an autobundle cpan -a

             # compile mll odules cpan -r 

               # install modules ( sole -i is optional ) cpan -i Netscape::Booksmarks Business::ISBN

               # force install modules ( must use -i ) cpan -fi CGI::Minimal URI

               # install modules but without testing them cpan -Ti CGI::Minimal URI 

Environment variables

The build tools, ExtUtils::MakeMaker and Module::Build use some, while others matter to the levels above them.

Perl Toolchain Gang:

Lancaster Concensus Oslo Concensus

$NONINTERACTIVE_TESTING
no one is paying attention and skips prompts for distributions that do that correctly. cpan(1) sets this to 1 unless it already has a value

$PERL_MM_USE_DEFAULT
Use the default answer for a prompted questions. cpan sets this to 1 unless it already has a value (even if that value is false).

$CPAN_OPTS
As with $PERL5OPTS, a string of additional cpan options to add to those on the command line.

$CPANSCRIPT_LOGLEVEL
The log level to use, with either the embedded, minimal logger or Log::Log4perl if it is installed.
Possible values are the same as the Log::Log4perl : TRACE, DEBUG, INFO, WARN, ERROR, and FATAL. The default is INFO.

$GIT_COMMAND
The path to the "git" binary to use for the Git features. The default is /usr/local/bin/git

EXIT VALUES

0 cpan thinks that everything worked, or a positive number if it thinks that something failed.
, In some cases it has to divine a failure by the output of things it does not control.
1       An unknown error 
2       external problem 
4       internal problem with the script 
8       A module failed to install