Additionally, you can use the notation using ~ and @ to specify version for a given module. ~ specifies the version requirement in the CPAN::Meta::Spec format, while @ pins the exact version, and is a shortcut for ~"== VERSION".

The version query including specific version or range will be sent to MetaCPAN to search for previous releases. The query will search for BackPAN archives by default, unless you specify --dev option, in which case, archived versions will be filtered out.

For a git repository, you can specify a branch, tag, or commit SHA to build. The default is master

Sets the local::lib compatible path to install modules to. You don't need to set this if you already configure the shell environment variables using local::lib, but this can be used to override that as well.

Same with --local-lib but with --self-contained set. All non-core dependencies will be installed even if they're already installed.

For instance,

cpanm -L extlib Plack

would install Plack and all of its non-core dependencies into the directory extlib, which can be loaded from your application with:

use local::lib '/path/to/extlib';

Note that this option does NOT reliably work with perl installations supplied by operating system vendors that strips standard modules from perl, such as RHEL, Fedora and CentOS, UNLESS you also install packages supplying all the modules that have been stripped. For these systems you will probably want to install the perl-core meta-package which does just that.

Specifies the base URL for the CPAN mirror to use, such as http://cpan.cpantesters.org/ (you can omit the trailing slash). You can specify multiple mirror URLs by repeating the command line option.

You can use a local directory that has a CPAN mirror structure (created by tools such as OrePAN or Pinto) by using a special URL scheme file://. If the given URL begins with `/` (without any scheme), it is considered as a file scheme as well.

Download the mirror's 02packages.details.txt.gz index file instead of querying the CPAN Meta DB. This will also effectively opt out sending your local perl versions to backend database servers such as CPAN Meta DB and MetaCPAN.

Select this option if you are using a local mirror of CPAN, such as minicpan when you're offline, or your own CPAN index (a.k.a darkpan).

Use the given mirror URL and its index as the only source to search and download modules from.

It works similar to --mirror and --mirror-only combined, with a small difference: unlike --mirror which appends the URL to the list of mirrors, --from (or -M for short) uses the specified URL as its only source to download index and modules from. This makes the option always override the default mirror, which might have been set via global options such as the one set by PERL_CPANM_OPT environment variable.

Tip: It might be useful if you name these options with your shell aliases, like:

Prompts when a test fails so that you can skip, force install, retry or look in the shell to see what's going wrong. It also prompts when one of the dependency failed if you want to proceed the installation.

Defaults to false, and you can say --no-prompt to override if it's set in the default options in PERL_CPANM_OPT.

EXPERIMENTAL: Installs dependencies declared as recommends and suggests respectively, per META spec. When these dependencies fail to install, cpanm continues the installation, since they're just recommendation/suggestion.

Enabling this could potentially make a circular dependency for a few modules on CPAN, when recommends adds a module that recommends back the module in return.

There's also --without-recommend and --without-suggests to override the default decision made earlier in PERL_CPANM_OPT.

DEPRECATED: Scans the depencencies of given modules and output the tree in a text format. (See --format below for more options)

Because this command doesn't actually install any distributions, it will be useful that by typing:

cpanm --scandeps Catalyst::Runtime

you can make sure what modules will be installed.

This command takes into account which modules you already have installed in your system. If you want to see what modules will be installed against a vanilla perl installation, you might want to combine it with -L option.

Uninstalls the shadow files of the distribution that you're installing. This eliminates the confusion if you're trying to install core (dual-life) modules from CPAN against perl 5.10 or older, or modules that used to be XS-based but switched to pure perl at some version.

If you run cpanm as root and use INSTALL_BASE or equivalent to specify custom installation path, you SHOULD disable this option so you won't accidentally uninstall dual-life modules from the core include path.

Defaults to true if your perl version is smaller than 5.12, and you can disable that with --no-uninst-shadows.

NOTE: Since version 1.3000 this flag is turned off by default for perl newer than 5.12, since with 5.12 @INC contains site_perl directory before the perl core library path, and uninstalling shadows is not necessary anymore and does more harm by deleting files from the core library path.

EXPERIMENTAL: Specifies whether a module (and version) given in the command line is skipped if it's already installed.

If you run:

cpanm --skip-satisfied CGI DBI~1.2

cpanm won't install them if you already have CGI (for whatever versions) or have DBI with version higher than 1.2. It is similar to --skip-installed but while --skip-installed checks if the latest version of CPAN is installed, --skip-satisfied checks if a requested version (or not, which means any version) is installed.

Uses GNU Wget (if available) to download stuff. Defaults to true, and you can say --no-wget to disable using Wget (versions of Wget older than 1.9 don't support the --retry-connrefused option used by cpanm).