App::c...torial(3pm)
π NAME π
App::cpm::Tutorial β it's the whole tutorial for cpm, bestie. You're reading a 3pm page, aka a User Contributed Perl Documentation manual page, and this one is literally the "how do I use cpm" bible. π
β¨ SYNOPSIS β¨
$ cpm install Module
That's it. That's the whole vibe. π
π¦ DESCRIPTION π¦
cpm is yet another CPAN client (like cpan, cpanp, and cpanm), which is fast! π₯ Not "kinda fast", not "fast-ish" β the page says fast, so fast. Periodt.
π How to install cpm π
From CPAN:
$ curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g App::cpm
Or, download a self-contained cpm:
$ curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm > cpm
$ chmod +x cpm
$ ./cpm --version
Two paths, both slay, pick your fighter. π«Ά
πΈ First step πΈ
$ cpm install Plack
This command installs Plack into ./local, and you can use it by
$ perl -I$PWD/local/lib/perl5 -MPlack -E 'say Plack->VERSION'
If you want to install modules into current INC instead of ./local, then use --global/-g option. π
$ cpm install --global Plack
By default, cpm outputs only DONE install Module things. So quiet, so demure. If you want more verbose messages, use --verbose/-v option. π£οΈ
$ cpm install --verbose Plack
π¦ Second step π¦
cpm can handle version range notation like cpanm. Let's see some examples. π
$ cpm install Plack~'> 1.000, <= 2.000'
$ cpm install Plack~'== 1.0030'
$ cpm install Plack@1.0030 # this is an alias of ~'== 1.0030'
cpm can install dev releases (TRIAL releases). π
$ cpm install Moose@dev
# if you prefer dev releases for not only Moose,
# but also its dependencies, then use global --dev option
$ cpm install --dev Moose
And cpm can install modules from git repositories directly. No cap. π§
$ cpm install https://github.com/skaji/Carl.git
π cpanfile and dist/url/mirror/git syntax π
If you omit arguments, and there exists one of
cpm.ymlβhttps://metacpan.org/pod/Module::cpmfilecpanfileβhttps://metacpan.org/dist/Module-CPANfile/view/lib/cpanfile.podMETA.jsonβhttps://metacpan.org/pod/CPAN::Meta::Spec(withdynamic_configfalse)"Build.PL""Makefile.PL"
in the current directory, then cpm loads modules from the file, and install them. π
$ cat cpanfile
requires 'Moose', '2.000';
requires 'Plack', '> 1.000, <= 2.000';
$ cpm install
If you have cpanfile.snapshot, then cpm tries to resolve distribution names from it. Iconic behaviour honestly. π
$ cpm install -v
30186 DONE resolve (0.001sec) Plack -> Plack-1.0030 (from Snapshot)
...
cpm supports dist/url/mirror syntax in cpanfile just like cpanminus:
requires 'Path::Class', 0.26,
dist => "KWILLIAMS/Path-Class-0.26.tar.gz";
# use dist + mirror
requires 'Cookie::Baker',
dist => "KAZEBURO/Cookie-Baker-0.08.tar.gz",
mirror => "http://cpan.cpantesters.org/";
# use the full URL
requires 'Try::Tiny', 0.28,
url => "http://backpan.perl.org/authors/id/E/ET/ETHER/Try-Tiny-0.28.tar.gz";
cpm also supports git syntax in cpanfile:
requires 'Carl', git => 'https://github.com/skaji/Carl.git';
requires 'App::cpm', git => 'https://login:password@github.com/skaji/cpm.git';
requires 'Perl::PrereqDistributionGatherer',
git => 'https://github.com/skaji/Perl-PrereqDistributionGatherer',
ref => '3850305'; # ref can be revision/branch/tag
π Please note that to support git syntax in cpanfile wholly, there are several TODOs. It's giving "works but not finished", and we're being honest about it.
π Darkpan integration π
There are CPAN modules that create darkpans (minicpan, CPAN mirror) such as CPAN::Mini, OrePAN2, Pinto.
Such darkpans store distribution tarballs in
DARKPAN/authors/id/A/AU/AUTHOR/Module-0.01.tar.gz
and create the de facto standard index file 02packages.details.txt.gz in
DARKPAN/modules/02packages.details.txt.gz
If you want to use cpm against such darkpans, change the cpm resolver by --resolver/-r option:
$ cpm install --resolver 02packages,http://example.com/darkpan Module
$ cpm install --resolver 02packages,file::///path/to/darkpan Module
If you host your own metadb for your own darkpan, you can use it too. Main character energy fr fr. π
$ cpm install \
--resolver metadb,http://example.com/darkmetadb,http://example.com/darkpan \
Module
okay that's the whole page bestie, you ate it π«Ά go install something and text me when it's DONE.
This tutorial came to you via perl v5.42.0, dated 2026-01-16, in the App::c...torial(3pm) section of the User Contributed Perl Documentation. πβ¨π
π¦ where this page comes from
- fedora 44: perl-App-cpm 0.998.3-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms