App::MechaCPAN::Install - Mechanize the installation of CPAN modules.
# Install Catalyst into local/ user@host:~$ mechacpan install Catalyst
user@host:~$ mechacpan install Catalyst
The install command is used for installing specific modules. All modules are installed into the local/ directory. It can accept module names in various formats. This includes:
install
local/
# Install from: foo-bar.tar.gz # * an archive foo::bar # * a CPAN module foo::bar@1.0 # * a specific module version foo::bar~<1.0 # * a module with version < 1.0 BAZ/foo-bar.tar.gz # * a PAUSE URL B/BA/BAZ/foo-bar.tar.gz # * a PAUSE URL https://example.com/foo-bar.zip # * a URL https://example.com/foo-bar.git # * a git repo https://example.com/foo-bar.git@master # * a git branch
MetaCPAN is used to search for modules by name.
There is only a single public function that should be called. This will install the modules listed in @srcs using the options in \%opts. The options available are listed in the arguments section below.
@srcs
\%opts
# Example of calling go App::MecahCPAN::Install->go({}, 'Try::Tiny');
By default the tests of each module will be ran. If you do not want to run tests when installing modules, use this option. Alternatively, you can use skip-tests-for to specify module names that will skip the tests for that module.
skip-tests-for
# Examples of --skip-tests mechacpan install Try::Tiny --skip-tests mechacpan install Catalyst --skip-tests-for=Moose
By default, man pages are not installed. Use this option to install the man pages.
Add a source translation to the installation. This can be used to translate a module name into another form, like using an exact version of a module or pull another module from its git repo. This can be repeated multiple times for multiple translations.
# Examples of --source mechacpan install Catalyst --source Try::Tiny=ETHER/Try-Tiny-0.24 mechacpan install Catalyst --source Catalyst=git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git
Do not use modules not listed in the source list. This means if you do not specify every module and every prerequisite in the source list, then it will not be installed. This doesn't sound very useful since you would be potentially listing hundreds of modules. However, this feature is mostly used in conjuncture with App::MechaCPAN::Deploy so that the modules listed in the cpanfile.snapshot are the only module versions used.
cpanfile.snapshot
Jon Gentle <cpan@atrodo.org>
Copyright 2017- Jon Gentle
This is free software. You may redistribute copies of it under the terms of the Artistic License 2 as published by The Perl Foundation.
To install App::MechaCPAN, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MechaCPAN
CPAN shell
perl -MCPAN -e shell install App::MechaCPAN
For more information on module installation, please visit the detailed CPAN module installation guide.