📄 cpan.3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "CPAN 3".TH CPAN 3 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"CPAN \- query, download and build perl modules from CPAN sites.SH "SYNOPSIS".IX Header "SYNOPSIS"Interactive mode:.PP.Vb 1\& perl \-MCPAN \-e shell.Ve.PP\&\-\-or\*(--.PP.Vb 1\& cpan.Ve.PPBasic commands:.PP.Vb 1\& # Modules:\&\& cpan> install Acme::Meta # in the shell\&\& CPAN::Shell\->install("Acme::Meta"); # in perl\&\& # Distributions:\&\& cpan> install NWCLARK/Acme\-Meta\-0.02.tar.gz # in the shell\&\& CPAN::Shell\->\& install("NWCLARK/Acme\-Meta\-0.02.tar.gz"); # in perl\&\& # module objects:\&\& $mo = CPAN::Shell\->expandany($mod);\& $mo = CPAN::Shell\->expand("Module",$mod); # same thing\&\& # distribution objects:\&\& $do = CPAN::Shell\->expand("Module",$mod)\->distribution;\& $do = CPAN::Shell\->expandany($distro); # same thing\& $do = CPAN::Shell\->expand("Distribution",\& $distro); # same thing.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"The \s-1CPAN\s0 module automates or at least simplifies the make and installof perl modules and extensions. It includes some primitive searchingcapabilities and knows how to use Net::FTP or \s-1LWP\s0 or some externaldownload clients to fetch the distributions from the net..PPThese are fetched from one or more of the mirrored \s-1CPAN\s0 (ComprehensivePerl Archive Network) sites and unpacked in a dedicated directory..PPThe \s-1CPAN\s0 module also supports the concept of named and versioned\&\fIbundles\fR of modules. Bundles simplify the handling of sets ofrelated modules. See Bundles below..PPThe package contains a session manager and a cache manager. Thesession manager keeps track of what has been fetched, built andinstalled in the current session. The cache manager keeps track of thedisk space occupied by the make processes and deletes excess spaceaccording to a simple \s-1FIFO\s0 mechanism..PPAll methods provided are accessible in a programmer style and in aninteractive shell style..ie n .Sh "CPAN::shell([$prompt, $command]) Starting Interactive Mode".el .Sh "CPAN::shell([$prompt, \f(CW$command\fP]) Starting Interactive Mode".IX Subsection "CPAN::shell([$prompt, $command]) Starting Interactive Mode"The interactive mode is entered by running.PP.Vb 1\& perl \-MCPAN \-e shell.Ve.PPor.PP.Vb 1\& cpan.Ve.PPwhich puts you into a readline interface. If \f(CW\*(C`Term::ReadKey\*(C'\fR andeither \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR or \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR are installedit supports both history and command completion..PPOnce you are on the command line, type \f(CW\*(C`h\*(C'\fR to get a one page helpscreen and the rest should be self-explanatory..PPThe function call \f(CW\*(C`shell\*(C'\fR takes two optional arguments, one is theprompt, the second is the default initial command line (the latteronly works if a real ReadLine interface module is installed)..PPThe most common uses of the interactive modes are.IP "Searching for authors, bundles, distribution files and modules" 2.IX Item "Searching for authors, bundles, distribution files and modules"There are corresponding one-letter commands \f(CW\*(C`a\*(C'\fR, \f(CW\*(C`b\*(C'\fR, \f(CW\*(C`d\*(C'\fR, and \f(CW\*(C`m\*(C'\fRfor each of the four categories and another, \f(CW\*(C`i\*(C'\fR for any of thementioned four. Each of the four entities is implemented as a classwith slightly differing methods for displaying an object..SpArguments you pass to these commands are either strings exactly matchingthe identification string of an object or regular expressions that arethen matched case-insensitively against various attributes of theobjects. The parser recognizes a regular expression only if youenclose it between two slashes..SpThe principle is that the number of found objects influences how anitem is displayed. If the search finds one item, the result isdisplayed with the rather verbose method \f(CW\*(C`as_string\*(C'\fR, but if we findmore than one, we display each object with the terse method\&\f(CW\*(C`as_glimpse\*(C'\fR..ie n .IP """get""\fR, \f(CW""make""\fR, \f(CW""test""\fR, \f(CW""install""\fR, \f(CW""clean"" modules or distributions" 2.el .IP "\f(CWget\fR, \f(CWmake\fR, \f(CWtest\fR, \f(CWinstall\fR, \f(CWclean\fR modules or distributions" 2.IX Item "get, make, test, install, clean modules or distributions"These commands take any number of arguments and investigate what isnecessary to perform the action. If the argument is a distributionfile name (recognized by embedded slashes), it is processed. If it isa module, \s-1CPAN\s0 determines the distribution file in which this moduleis included and processes that, following any dependencies named inthe module's \s-1META\s0.yml or Makefile.PL (this behavior is controlled bythe configuration parameter \f(CW\*(C`prerequisites_policy\*(C'\fR.).Sp\&\f(CW\*(C`get\*(C'\fR downloads a distribution file and untars or unzips it, \f(CW\*(C`make\*(C'\fRbuilds it, \f(CW\*(C`test\*(C'\fR runs the test suite, and \f(CW\*(C`install\*(C'\fR installs it..SpAny \f(CW\*(C`make\*(C'\fR or \f(CW\*(C`test\*(C'\fR are run unconditionally. An.Sp.Vb 1\& install <distribution_file>.Ve.Spalso is run unconditionally. But for.Sp.Vb 1\& install <module>.Ve.Sp\&\s-1CPAN\s0 checks if an install is actually needed for it and prints\&\fImodule up to date\fR in the case that the distribution file containingthe module doesn't need to be updated..Sp\&\s-1CPAN\s0 also keeps track of what it has done within the current sessionand doesn't try to build a package a second time regardless if itsucceeded or not. It does not repeat a test run if the testhas been run successfully before. Same for install runs..SpThe \f(CW\*(C`force\*(C'\fR pragma may precede another command (currently: \f(CW\*(C`get\*(C'\fR,\&\f(CW\*(C`make\*(C'\fR, \f(CW\*(C`test\*(C'\fR, or \f(CW\*(C`install\*(C'\fR) and executes the command from scratchand tries to continue in case of some errors. See the section below onthe \f(CW\*(C`force\*(C'\fR and the \f(CW\*(C`fforce\*(C'\fR pragma..SpThe \f(CW\*(C`notest\*(C'\fR pragma may be used to skip the test part in the buildprocess..SpExample:.Sp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -