📄 cpanplus::inc.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 "CPANPLUS::inc 3".TH CPANPLUS::inc 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"CPANPLUS::inc.SH "DESCRIPTION".IX Header "DESCRIPTION"\&\s-1OBSOLETE\s0.SH "NAME"CPANPLUS::inc \- runtime inclusion of privately bundled modules.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 2\& ### set up CPANPLUS::inc to do it\*(Aqs thing ###\& BEGIN { use CPANPLUS::inc };\&\& ### enable debugging ###\& use CPANPLUS::inc qw[DEBUG];.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This module enables the use of the bundled modules in the\&\f(CW\*(C`CPANPLUS/inc\*(C'\fR directory of this package. These modules are bundledto make sure \f(CW\*(C`CPANPLUS\*(C'\fR is able to bootstrap itself. It will do thefollowing things:.ie n .IP "Put a coderef at the beginning of @INC" 4.el .IP "Put a coderef at the beginning of \f(CW@INC\fR" 4.IX Item "Put a coderef at the beginning of @INC"This allows us to decide which module to load, and where to find it.For details on what we do, see the \f(CW\*(C`INTERESTING MODULES\*(C'\fR section below.Also see the \f(CW\*(C`CAVEATS\*(C'\fR section..ie n .IP "Add the full path to the ""CPANPLUS/inc""\fR directory to \f(CW""$ENV{PERL5LIB""." 4.el .IP "Add the full path to the \f(CWCPANPLUS/inc\fR directory to \f(CW$ENV{PERL5LIB\fR." 4.IX Item "Add the full path to the CPANPLUS/inc directory to $ENV{PERL5LIB."This allows us to find our bundled modules even if we spawn off a newprocess. Although it's not able to do the selective loading as thecoderef in \f(CW@INC\fR could, it's a good fallback..SH "METHODS".IX Header "METHODS".Sh "CPANPLUS::inc\->\fIinc_path()\fP".IX Subsection "CPANPLUS::inc->inc_path()"Returns the full path to the \f(CW\*(C`CPANPLUS/inc\*(C'\fR directory..Sh "CPANPLUS::inc\->\fImy_path()\fP".IX Subsection "CPANPLUS::inc->my_path()"Returns the full path to be added to \f(CW@INC\fR to load\&\f(CW\*(C`CPANPLUS::inc\*(C'\fR from..Sh "CPANPLUS::inc\->\fIinstaller_path()\fP".IX Subsection "CPANPLUS::inc->installer_path()"Returns the full path to the \f(CW\*(C`CPANPLUS/inc/installers\*(C'\fR directory..Sh "CPANPLUS::inc\->original_perl5lib".IX Subsection "CPANPLUS::inc->original_perl5lib"Returns the value of \f(CW$ENV\fR{\s-1PERL5LIB\s0} the way it was when \f(CW\*(C`CPANPLUS::inc\*(C'\fRgot loaded..Sh "CPANPLUS::inc\->original_perl5opt".IX Subsection "CPANPLUS::inc->original_perl5opt"Returns the value of \f(CW$ENV\fR{\s-1PERL5OPT\s0} the way it was when \f(CW\*(C`CPANPLUS::inc\*(C'\fRgot loaded..Sh "CPANPLUS::inc\->original_inc".IX Subsection "CPANPLUS::inc->original_inc"Returns the value of \f(CW@INC\fR the way it was when \f(CW\*(C`CPANPLUS::inc\*(C'\fR gotloaded..Sh "CPANPLUS::inc\->limited_perl5opt(@modules);".IX Subsection "CPANPLUS::inc->limited_perl5opt(@modules);"Returns a string you can assign to \f(CW$ENV{PERL5OPT}\fR to have a limitedinclude facility from \f(CW\*(C`CPANPLUS::inc\*(C'\fR. It will roughly look like:.PP.Vb 1\& \-I/path/to/cpanplus/inc \-MCPANPLUS::inc=module1,module2.Ve.Sh "CPANPLUS::inc\->\fIinteresting_modules()\fP".IX Subsection "CPANPLUS::inc->interesting_modules()"Returns a hashref with modules we're interested in, and the minimumversion we need to find..PPIt would looks something like this:.PP.Vb 4\& { File::Fetch => 0.06,\& IPC::Cmd => 0.22,\& ....\& }.Ve.SH "INTERESTING MODULES".IX Header "INTERESTING MODULES"\&\f(CW\*(C`CPANPLUS::inc\*(C'\fR doesn't even bother to try find and find a moduleit's not interested in. A list of \fIinteresting modules\fR can beobtained using the \f(CW\*(C`interesting_modules\*(C'\fR method described above..PPNote that all subclassed modules of an \f(CW\*(C`interesting module\*(C'\fR willalso be attempted to be loaded, but a version will not be checked..PPWhen it however does encounter a module it is interested in, it willdo the following things:.ie n .IP "Loop over your @INC" 4.el .IP "Loop over your \f(CW@INC\fR" 4.IX Item "Loop over your @INC"And for every directory it finds there (skipping all non directories\&\*(-- see the \f(CW\*(C`CAVEATS\*(C'\fR section), see if the module requested can befound there..ie n .IP "Check the version on every suitable module found in @INC" 4.el .IP "Check the version on every suitable module found in \f(CW@INC\fR" 4.IX Item "Check the version on every suitable module found in @INC"After a list of modules has been gathered, the version of each of themis checked to find the one with the highest version, and return that asthe module to \f(CW\*(C`use\*(C'\fR..SpThis enables us to use a recent enough version from our own bundledmodules, but also to use a \fInewer\fR module found in your path instead,if it is present. Thus having access to bugfixed versions as they arereleased..SpIf for some reason no satisfactory version could be found, a warningwill be emitted. See the \f(CW\*(C`DEBUG\*(C'\fR section for more details on how tofind out exactly what \f(CW\*(C`CPANPLUS::inc\*(C'\fR is doing..SH "DEBUG".IX Header "DEBUG"Since this module does \f(CW\*(C`Clever Things\*(C'\fR to your search path, it mightbe nice sometimes to figure out what it's doing, if things don't workas expected. You can enable a debug trace by calling the module likethis:.PP.Vb 1\& use CPANPLUS::inc \*(AqDEBUG\*(Aq;.Ve.PPThis will show you what \f(CW\*(C`CPANPLUS::inc\*(C'\fR is doing, which might looksomething like this:.PP.Vb 6\& CPANPLUS::inc: Found match for \*(AqParams::Check\*(Aq in\& \*(Aq/opt/lib/perl5/site_perl/5.8.3\*(Aq with version \*(Aq0.07\*(Aq\& CPANPLUS::inc: Found match for \*(AqParams::Check\*(Aq in\& \*(Aq/my/private/lib/CPANPLUS/inc\*(Aq with version \*(Aq0.21\*(Aq\& CPANPLUS::inc: Best match for \*(AqParams::Check\*(Aq is found in\& \*(Aq/my/private/lib/CPANPLUS/inc\*(Aq with version \*(Aq0.21\*(Aq.Ve.SH "CAVEATS".IX Header "CAVEATS"This module has 2 major caveats, that could lead to unexpectedbehaviour. But currently I don't know how to fix them, Suggestionsare much welcomed..ie n .IP "On multiple ""use lib""\fR calls, our coderef may not be the first in \f(CW@INC" 4.el .IP "On multiple \f(CWuse lib\fR calls, our coderef may not be the first in \f(CW@INC\fR" 4.IX Item "On multiple use lib calls, our coderef may not be the first in @INC"If this happens, although unlikely in most situations and not happeningwhen calling the shell directly, this could mean that a lower (too low)versioned module is loaded, which might cause failures in theapplication..ie n .IP "Non-directories in @INC" 4.el .IP "Non-directories in \f(CW@INC\fR" 4.IX Item "Non-directories in @INC"Non-directories are right now skipped by CPANPLUS::inc. They could ofcourse lead us to newer versions of a module, but it's too tricky toverify if they would. Therefor they are skipped. In the worst casescenario we'll find the sufficing version bundled with \s-1CPANPLUS\s0.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -