App-cpm
view release on metacpan or search on metacpan
lib/App/cpm/Tutorial.pm view on Meta::CPAN
package App::cpm::Tutorial;
use v5.24;
use warnings;
use experimental qw(lexical_subs signatures);
1;
__END__
=head1 NAME
App::cpm::Tutorial - How to use cpm
=head1 SYNOPSIS
$ cpm install Module
=head1 DESCRIPTION
cpm is yet another CPAN client (like L<cpan>, L<cpanp>, and L<cpanm>),
which is fast!
=head2 How to install cpm
From CPAN:
$ curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g App::cpm
Or, download a I<self-contained> cpm:
$ curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm > cpm
$ chmod +x cpm
$ ./cpm --version
=head2 First step
$ cpm install Plack
This command installs Plack into C<./local>, and you can use it by
$ perl -I$PWD/local/lib/perl5 -MPlack -E 'say Plack->VERSION'
By default, cpm installs the requested distributions and their runtime
dependency closure.
If you want to install modules into current INC instead of C<./local>,
then use C<--global/-g> option.
$ cpm install --global Plack
By default, cpm chooses a progress mode automatically. On interactive
terminals, it usually shows the terminal progress UI. Otherwise, it
uses plain line-by-line output.
If you want plain output explicitly, use C<--progress=plain>. If you
want more verbose messages, use C<--verbose/-v> option.
$ cpm install --progress=plain Plack
$ cpm install --verbose Plack
=head2 Second step
cpm can handle version range notation like L<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.
$ cpm install https://github.com/skaji/Carl.git
=head2 cpanfile and dist/url/mirror/git syntax
If you omit arguments, and there exists one of
=over 4
=item L<cpm.yml|https://metacpan.org/pod/Module::cpmfile>
=item L<cpanfile|https://metacpan.org/dist/Module-CPANfile/view/lib/cpanfile.pod>
=item L<META.json|https://metacpan.org/pod/CPAN::Meta::Spec> (with dynamic_config false)
( run in 1.644 second using v1.01-cache-2.11-cpan-39bf76dae61 )