LinuxCommandLibrary

cpanp

Install and manage Perl modules

SYNOPSIS

cpanp [options] [module|dist|bundle ...]

PARAMETERS

-i, --install
    Install specified modules/distributions

-g, --get
    Download source tarballs only

-t, --test
    Run tests without installing

-f, --force
    Force installation, skipping checks

-r, --recurse
    Recursively install dependencies

-T, --skip-test
    Skip running tests

-v, --verbose
    Increase output verbosity

-q, --quiet
    Reduce output verbosity

--target DIR
    Set custom target directory

--source URL
    Specify alternate CPAN source

--prereqs MODE
    Control prerequisite handling (ask|follow|ignore)

--save
    Save configuration changes

--list
    List available actions or modules

--search TERM
    Search for modules/distributions

--hintfile FILE
    Use specific hint file for configuration

DESCRIPTION

cpanp is the command-line interface to CPANPLUS, an advanced, extensible CPAN client for Perl. Unlike the basic cpan tool, cpanp supports pausing and resuming installations, better dependency handling, and integration with multiple sources like CPAN, PAUSE, and local directories.

It offers an interactive shell mode for exploring modules, searching distributions, and managing reports. Non-interactively, it installs, tests, or downloads Perl modules with options for verbosity, forcing overwrites, and skipping tests. CPANPLUS emphasizes configurability via CPANPLUS::Config, allowing customization of mirrors, preferences, and plugins.

Key strengths include recursive dependency resolution, support for bundles, and extensibility through plugins for custom fetchers or extractors. It's particularly useful for complex environments or scripted installs, though modern alternatives like cpanm have gained popularity for simplicity.

CAVEATS

CPANPLUS and cpanp are considered legacy; prefer cpanm or cpan for new projects. Interactive mode may be slow on large indexes. Requires Perl 5.6+ and CPANPLUS module.

INTERACTIVE MODE

Run cpanp without args to enter shell. Use ? help for commands like ls dists, i Foo::Bar.

CONFIGURATION

Edit via cpanp --configure or ~/.cpanplus/config file. Supports mirrors, autorespond settings, and plugins.

EXAMPLE USAGE

cpanp -fi Acme::Foo (force install); cpanp -g -r Foo::Bar (download deps).

HISTORY

Developed in 2003 by Ken Williams and others as CPANPLUS (initial release 0.01). Kan Fushihara led enhancements; version 0.91 (2012) stabilized features. Integrated into Perl core distributions until Perl 5.22, now external via CPAN.

SEE ALSO

cpan(1), cpanm(1), cpanminus(1), perl(1)

Copied to clipboard