⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpan.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 5 页
字号:
\&    mode: deterministic\&    timeout: 15\&    talk: <array>.Ve.ie n .Sh "Schema verification with ""Kwalify""".el .Sh "Schema verification with \f(CWKwalify\fP".IX Subsection "Schema verification with Kwalify"If you have the \f(CW\*(C`Kwalify\*(C'\fR module installed (which is part of theBundle::CPANxxl), then all your distroprefs files are checked forsyntactical correctness..Sh "Example Distroprefs Files".IX Subsection "Example Distroprefs Files"\&\f(CW\*(C`CPAN.pm\*(C'\fR comes with a collection of example \s-1YAML\s0 files. Note that theseare really just examples and should not be used without care becausethey cannot fit everybody's purpose. After all the authors of thepackages that ask questions had a need to ask, so you should watchtheir questions and adjust the examples to your environment and yourneeds. You have beend warned:\-).SH "PROGRAMMER'S INTERFACE".IX Header "PROGRAMMER'S INTERFACE"If you do not enter the shell, the available shell commands are bothavailable as methods (\f(CW\*(C`CPAN::Shell\->install(...)\*(C'\fR) and asfunctions in the calling package (\f(CW\*(C`install(...)\*(C'\fR).  Before calling low-levelcommands it makes sense to initialize components of \s-1CPAN\s0 you need, e.g.:.PP.Vb 3\&  CPAN::HandleConfig\->load;\&  CPAN::Shell::setup_output;\&  CPAN::Index\->reload;.Ve.PPHigh-level commands do such initializations automatically..PPThere's currently only one class that has a stable interface \-CPAN::Shell. All commands that are available in the \s-1CPAN\s0 shell aremethods of the class CPAN::Shell. Each of the commands that producelistings of modules (\f(CW\*(C`r\*(C'\fR, \f(CW\*(C`autobundle\*(C'\fR, \f(CW\*(C`u\*(C'\fR) also return a list ofthe IDs of all modules within the list..IP "expand($type,@things)" 2.IX Item "expand($type,@things)"The IDs of all objects available within a program are strings that canbe expanded to the corresponding real objects with the\&\f(CW\*(C`CPAN::Shell\->expand("Module",@things)\*(C'\fR method. Expand returns alist of CPAN::Module objects according to the \f(CW@things\fR argumentsgiven. In scalar context it only returns the first element of thelist..IP "expandany(@things)" 2.IX Item "expandany(@things)"Like expand, but returns objects of the appropriate type, i.e.CPAN::Bundle objects for bundles, CPAN::Module objects for modules andCPAN::Distribution objects for distributions. Note: it does not expandto CPAN::Author objects..IP "Programming Examples" 2.IX Item "Programming Examples"This enables the programmer to do operations that combinefunctionalities that are available in the shell..Sp.Vb 2\&    # install everything that is outdated on my disk:\&    perl \-MCPAN \-e \*(AqCPAN::Shell\->install(CPAN::Shell\->r)\*(Aq\&\&    # install my favorite programs if necessary:\&    for $mod (qw(Net::FTP Digest::SHA Data::Dumper)) {\&        CPAN::Shell\->install($mod);\&    }\&\&    # list all modules on my disk that have no VERSION number\&    for $mod (CPAN::Shell\->expand("Module","/./")) {\&        next unless $mod\->inst_file;\&        # MakeMaker convention for undefined $VERSION:\&        next unless $mod\->inst_version eq "undef";\&        print "No VERSION in ", $mod\->id, "\en";\&    }\&\&    # find out which distribution on CPAN contains a module:\&    print CPAN::Shell\->expand("Module","Apache::Constants")\->cpan_file.Ve.SpOr if you want to write a cronjob to watch The \s-1CPAN\s0, you could listall modules that need updating. First a quick and dirty way:.Sp.Vb 1\&    perl \-e \*(Aquse CPAN; CPAN::Shell\->r;\*(Aq.Ve.SpIf you don't want to get any output in the case that all modules areup to date, you can parse the output of above command for the regularexpression //modules are up to date// and decide to mail the outputonly if it doesn't match. Ick?.SpIf you prefer to do it more in a programmer style in one singleprocess, maybe something like this suits you better:.Sp.Vb 7\&  # list all modules on my disk that have newer versions on CPAN\&  for $mod (CPAN::Shell\->expand("Module","/./")) {\&    next unless $mod\->inst_file;\&    next if $mod\->uptodate;\&    printf "Module %s is installed as %s, could be updated to %s from CPAN\en",\&        $mod\->id, $mod\->inst_version, $mod\->cpan_version;\&  }.Ve.SpIf that gives you too much output every day, you maybe only want towatch for three modules. You can write.Sp.Vb 1\&  for $mod (CPAN::Shell\->expand("Module","/Apache|LWP|CGI/")) {.Ve.Spas the first line instead. Or you can combine some of the abovetricks:.Sp.Vb 5\&  # watch only for a new mod_perl module\&  $mod = CPAN::Shell\->expand("Module","mod_perl");\&  exit if $mod\->uptodate;\&  # new mod_perl arrived, let me know all update recommendations\&  CPAN::Shell\->r;.Ve.Sh "Methods in the other Classes".IX Subsection "Methods in the other Classes".IP "\fICPAN::Author::as_glimpse()\fR" 4.IX Item "CPAN::Author::as_glimpse()"Returns a one-line description of the author.IP "\fICPAN::Author::as_string()\fR" 4.IX Item "CPAN::Author::as_string()"Returns a multi-line description of the author.IP "\fICPAN::Author::email()\fR" 4.IX Item "CPAN::Author::email()"Returns the author's email address.IP "\fICPAN::Author::fullname()\fR" 4.IX Item "CPAN::Author::fullname()"Returns the author's name.IP "\fICPAN::Author::name()\fR" 4.IX Item "CPAN::Author::name()"An alias for fullname.IP "\fICPAN::Bundle::as_glimpse()\fR" 4.IX Item "CPAN::Bundle::as_glimpse()"Returns a one-line description of the bundle.IP "\fICPAN::Bundle::as_string()\fR" 4.IX Item "CPAN::Bundle::as_string()"Returns a multi-line description of the bundle.IP "\fICPAN::Bundle::clean()\fR" 4.IX Item "CPAN::Bundle::clean()"Recursively runs the \f(CW\*(C`clean\*(C'\fR method on all items contained in the bundle..IP "\fICPAN::Bundle::contains()\fR" 4.IX Item "CPAN::Bundle::contains()"Returns a list of objects' IDs contained in a bundle. The associatedobjects may be bundles, modules or distributions..IP "CPAN::Bundle::force($method,@args)" 4.IX Item "CPAN::Bundle::force($method,@args)"Forces \s-1CPAN\s0 to perform a task that it normally would have refused todo. Force takes as arguments a method name to be called and any numberof additional arguments that should be passed to the called method.The internals of the object get the needed changes so that \s-1CPAN\s0.pmdoes not refuse to take the action. The \f(CW\*(C`force\*(C'\fR is passed recursivelyto all contained objects. See also the section above on the \f(CW\*(C`force\*(C'\fRand the \f(CW\*(C`fforce\*(C'\fR pragma..IP "\fICPAN::Bundle::get()\fR" 4.IX Item "CPAN::Bundle::get()"Recursively runs the \f(CW\*(C`get\*(C'\fR method on all items contained in the bundle.IP "\fICPAN::Bundle::inst_file()\fR" 4.IX Item "CPAN::Bundle::inst_file()"Returns the highest installed version of the bundle in either \f(CW@INC\fR or\&\f(CW\*(C`$CPAN::Config\-\*(C'\fR{cpan_home}>. Note that this is different fromCPAN::Module::inst_file..IP "\fICPAN::Bundle::inst_version()\fR" 4.IX Item "CPAN::Bundle::inst_version()"Like CPAN::Bundle::inst_file, but returns the \f(CW$VERSION\fR.IP "\fICPAN::Bundle::uptodate()\fR" 4.IX Item "CPAN::Bundle::uptodate()"Returns 1 if the bundle itself and all its members are uptodate..IP "\fICPAN::Bundle::install()\fR" 4.IX Item "CPAN::Bundle::install()"Recursively runs the \f(CW\*(C`install\*(C'\fR method on all items contained in the bundle.IP "\fICPAN::Bundle::make()\fR" 4.IX Item "CPAN::Bundle::make()"Recursively runs the \f(CW\*(C`make\*(C'\fR method on all items contained in the bundle.IP "\fICPAN::Bundle::readme()\fR" 4.IX Item "CPAN::Bundle::readme()"Recursively runs the \f(CW\*(C`readme\*(C'\fR method on all items contained in the bundle.IP "\fICPAN::Bundle::test()\fR" 4.IX Item "CPAN::Bundle::test()"Recursively runs the \f(CW\*(C`test\*(C'\fR method on all items contained in the bundle.IP "\fICPAN::Distribution::as_glimpse()\fR" 4.IX Item "CPAN::Distribution::as_glimpse()"Returns a one-line description of the distribution.IP "\fICPAN::Distribution::as_string()\fR" 4.IX Item "CPAN::Distribution::as_string()"Returns a multi-line description of the distribution.IP "CPAN::Distribution::author" 4.IX Item "CPAN::Distribution::author"Returns the CPAN::Author object of the maintainer who uploaded thisdistribution.IP "\fICPAN::Distribution::pretty_id()\fR" 4.IX Item "CPAN::Distribution::pretty_id()"Returns a string of the form \*(L"\s-1AUTHORID/TARBALL\s0\*(R", where \s-1AUTHORID\s0 is theauthor's \s-1PAUSE\s0 \s-1ID\s0 and \s-1TARBALL\s0 is the distribution filename..IP "\fICPAN::Distribution::base_id()\fR" 4.IX Item "CPAN::Distribution::base_id()"Returns the distribution filename without any archive suffix.  E.g\&\*(L"Foo\-Bar\-0.01\*(R".IP "\fICPAN::Distribution::clean()\fR" 4.IX Item "CPAN::Distribution::clean()"Changes to the directory where the distribution has been unpacked andruns \f(CW\*(C`make clean\*(C'\fR there..IP "\fICPAN::Distribution::containsmods()\fR" 4.IX Item "CPAN::Distribution::containsmods()"Returns a list of IDs of modules contained in a distribution file.Only works for distributions listed in the 02packages.details.txt.gzfile. This typically means that only the most recent version of adistribution is covered..IP "\fICPAN::Distribution::cvs_import()\fR" 4.IX Item "CPAN::Distribution::cvs_import()"Changes to the directory where the distribution has been unpacked andruns something like.Sp.Vb 1\&    cvs \-d $cvs_root import \-m $cvs_log $cvs_dir $userid v$version.Ve.Spthere..IP "\fICPAN::Distribution::dir()\fR" 4.IX Item "CPAN::Distribution::dir()"Returns the directory into which this distribution has been unpacked..IP "CPAN::Distribution::force($method,@args)" 4.IX Item "CPAN::Distribution::force($method,@args)"Forces \s-1CPAN\s0 to perform a task that it normally would have refused todo. Force takes as arguments a method name to be called and any numberof additional arguments that should be passed to the called method.The internals of the object get the needed changes so that \s-1CPAN\s0.pmdoes not refuse to take the action. See also the section above on the\&\f(CW\*(C`force\*(C'\fR and the \f(CW\*(C`fforce\*(C'\fR pragma..IP "\fICPAN::Distribution::get()\fR" 4.IX Item "CPAN::Distribution::get()"Downloads the distribution from \s-1CPAN\s0 and unpacks it. Does nothing ifthe distribution has already been downloaded and unpacked within thecurrent session..IP "\fICPAN::Distribution::install()\fR" 4.IX Item "CPAN::Distribution::install()"Changes to the directory where the distribution has been unpacked andruns the external command \f(CW\*(C`make install\*(C'\fR there. If \f(CW\*(C`make\*(C'\fR has notyet been run, it will be run first. A \f(CW\*(C`make test\*(C'\fR will be issued inany case and if this fails, the install will be canceled. Thecancellation can be avoided by letting \f(CW\*(C`force\*(C'\fR run the \f(CW\*(C`install\*(C'\fR foryou..SpThis install method has only the power to install the distribution ifthere are no dependencies in the way. To install an object and all ofits dependencies, use CPAN::Shell\->install..SpNote that \fIinstall()\fR gives no meaningful return value. See \fIuptodate()\fR..IP "\fICPAN::Distribution::install_tested()\fR" 4.IX Item "CPAN::Distribution::install_tested()"Install all the distributions that have been tested sucessfully butnot yet installed. See also \f(CW\*(C`is_tested\*(C'\fR..IP "\fICPAN::Distribution::isa_perl()\fR" 4.IX Item "CPAN::Distribution::isa_perl()"Returns 1 if this distribution file seems to be a perl distribution.Normally this is derived from the file name only, but the index from\&\s-1CPAN\s0 can contain a hint to achieve a return value of true for otherfilenames too..IP "\fICPAN::Distribution::is_tested()\fR" 4.IX Item "CPAN::Distribution::is_tested()"List all the distributions that have been tested sucessfully but notyet installed. See also \f(CW\*(C`install_tested\*(C'\fR..IP "\fICPAN::Distribution::look()\fR" 4.IX Item "CPAN::Distribution::look()"Changes to the directory where the distribution has been unpacked andopens a subshell there. Exiting the subshell returns..IP "\fICPAN::Distribution::make()\fR" 4.IX Item "CPAN::Distribution::make()"First runs the \f(CW\*(C`get\*(C'\fR method to make sure the distribution isdownloaded and unpacked. Changes to the directory where thedistribution has been unpacked and runs the external commands \f(CW\*(C`perlMakefile.PL\*(C'\fR or \f(CW\*(C`perl Build.PL\*(C'\fR and \f(CW\*(C`make\*(C'\fR there..IP "\fICPAN::Distribution::perldoc()\fR" 4.IX Item "CPAN::Distribution::perldoc()"Downloads the pod documentation of the file associated with adistribution (in html format) and runs it through the externalcommand lynx specified in \f(CW\*(C`$CPAN::Config\-\*(C'\fR{lynx}>. If lynxisn't available, it converts it to plain text with externalcommand html2text and runs it through the pager specifiedin \f(CW\*(C`$CPAN::Config\-\*(C'\fR{pager}>.IP "\fICPAN::Distribution::prefs()\fR" 4.IX Item "CPAN::Distribution::prefs()"Returns the hash reference from the first matching \s-1YAML\s0 file that theuser has deposited in the \f(CW\*(C`prefs_dir/\*(C'\fR directory. The firstsucceeding match wins. The files in the \f(CW\*(C`prefs_dir/\*(C'\fR are processedalphabetically and the canonical distroname (e.g.AUTHOR/Foo\-Bar\-3.14.tar.gz) is matched a

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -