Section: Perl Programmers Reference Guide (1)
# with arguments and no switches, installs specified modules cpan module_name [ module_name ... ] # with switches, installs modules with extra behavior cpan [-cfgimtTw] module_name [ module_name ... ] # with just the dot, install from the distribution in the # current directory cpan . # without arguments, starts CPAN.pm shell cpan # dump the configuration cpan -J # load a different configuration to install Module::Foo cpan -j some/other/file Module::Foo # without arguments, but some switches cpan [-ahrvACDlLO]
% cpan -f -i Module::Foo:
"-j", and that config sets up its own work directories.:
Download to the current directory the latest distribution of the modules, unpack each distribution, and create a git repository for each distribution.If you want this feature, check out Yanick Champoux's
"-h", it ignores all of the other options and arguments.:
"-I"for loading lib paths).:
$CPAN::Configas an anonymous hash.:
Turn on cpan warnings. This checks various things, like directory permissions, and tells you about problems you might have.
# print a help message cpan -h # print the version numbers cpan -v # create an autobundle cpan -a # recompile modules cpan -r # upgrade all installed modules cpan -u # install modules ( sole -i is optional ) cpan -i Netscape::Booksmarks Business::ISBN # force install modules ( must use -i ) cpan -fi CGI::Minimal URI
"cpan"splits this variable on whitespace and prepends that list to
@ARGVbefore it processes the command-line arguments. For instance, if you always want to use
"local:lib", you can set
The script exits with zero if it thinks that everything worked, or a positive number if it thinks that something failed. Note, however, that in some cases it has to divine a failure by the output of things it does not control. For now, the exit codes are vague:
1 An unknown error 2 The was an external problem 4 There was an internal problem with the script 8 A module failed to install
This code is in Github:
Japheth Cleaver added the bits to allow a forced install (-f).
Jim Brandt suggest and provided the initial implementation for the up-to-date and Changes features.
Copyright (c) 2001-2013, brian d foy, All Rights Reserved.
You may redistribute this under the same terms as Perl itself.
Tutoriais de Tecnologia Web