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

📄 ch22_01.htm

📁 编程珍珠,里面很多好用的代码,大家可以参考学习呵呵,
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<html><head><title>CPAN (Programming Perl)</title><!-- STYLESHEET --><link rel="stylesheet" type="text/css" href="../style/style1.css"><!-- METADATA --><!--Dublin Core Metadata--><meta name="DC.Creator" content=""><meta name="DC.Date" content=""><meta name="DC.Format" content="text/xml" scheme="MIME"><meta name="DC.Generator" content="XSLT stylesheet, xt by James Clark"><meta name="DC.Identifier" content=""><meta name="DC.Language" content="en-US"><meta name="DC.Publisher" content="O'Reilly &amp; Associates, Inc."><meta name="DC.Source" content="" scheme="ISBN"><meta name="DC.Subject.Keyword" content=""><meta name="DC.Title" content="CPAN"><meta name="DC.Type" content="Text.Monograph"></head><body><!-- START OF BODY --><!-- TOP BANNER --><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home"><map name="banner-map"><AREA SHAPE="RECT" COORDS="0,0,466,71" HREF="index.htm" ALT="Programming Perl"><AREA SHAPE="RECT" COORDS="467,0,514,18" HREF="jobjects/fsearch.htm" ALT="Search this book"></map><!-- TOP NAV BAR --><div class="navbar"><table width="515" border="0"><tr><td align="left" valign="top" width="172"><a href="part4.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="part4.htm">Part 4: Perl as Culture</a></td><td align="right" valign="top" width="172"><a href="ch22_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr></table></div><hr width="515" align="left"><!-- SECTION BODY --><h1 class="chapter">Chapter 22.  CPAN</h1><div class="htmltoc"><h4 class="tochead">Contents:</h4><p><a href="ch22_01.htm">The CPAN modules Directory</a><br><a href="ch22_02.htm">Using CPAN Modules</a><br><a href="ch22_03.htm">Creating CPAN Modules</a><br></p></div><p><a name="INDEX-3788"></a><a name="INDEX-3789"></a>CPAN (the Comprehensive Perl Archive Network) is the centralrepository for everything Perl.  It contains the collected wisdom ofthe entire Perl community: hundreds of Perl modules and scripts,several books' worth of documentation, and the entire Perldistribution. If it's written in Perl, and it's helpful and free, it'sprobably on CPAN.  CPAN is mirrored worldwide, and you can find anearby mirror with the CPAN multiplexer at<a href="http://www.perl.com/CPAN">http://www.perl.com/CPAN</a>.  The multiplexerwill remember which mirror you choose so that when you visit<a href="http://www.perl.com/CPAN/">http://www.perl.com/CPAN/</a> (note the trailingslash) you'll be automatically redirected to that mirror.Alternatively, you can start at www.cpan.org.The interface is different, but the data is the same.</p><p>Once you get to the main CPAN directory, you'll see some subdirectories:</p><dl><dt><b><em class="emphasis">authors</em></b></dt><dd><p><a name="INDEX-3790"></a>This directory contains numerous subdirectories, one for eachcontributor of software.  For example, if you wanted to find LincolnStein's great CGI module<a href="#FOOTNOTE-1">[1]</a> and you happened to know for a factthat he wrote it, you could look in<em class="emphasis">authors/Lincoln_Stein</em>.  If you didn't know hewrote it, you could look in the <em class="emphasis">modules</em> directorydescribed below.</p><blockquote class="footnote"><a name="FOOTNOTE-1"></a><p>[1]Now part of the standard Perldistribution.</p></blockquote></dd><dt><b><em class="emphasis">doc</em></b></dt><dd><p><a name="INDEX-3791"></a><a name="INDEX-3792"></a>This directory holds all manner of Perl documentation, including all ofPerl's official manpages in several differentarrangements and formats, such as text, HTML, PostScript, and Perl'snative pod format, documented in <a href="ch26_01.htm">Chapter 26, "Plain Old Documentation"</a>.</p></dd><dt><b><em class="emphasis">modules</em></b></dt><dd><p><a name="INDEX-3793"></a>This directory contains modules written either in Perl or in a combination of both Perl and C.  See thediscussion of the <em class="emphasis">modules</em> directory below.</p></dd><dt><b><em class="emphasis">ports</em></b></dt><dd><p><a name="INDEX-3794"></a><a name="INDEX-3795"></a>This directory contains the source code and sometimes also precompiledexecutable images of Perl ports to operating systems that arenot directly supported in the standard distribution, or for whichcompilers are notoriously hard to come by.  These ports are theindividual efforts of their respective authors and may not allfunction precisely as described in this book.  These days few systemsshould require special ports.  The index document of this directory isinteresting to look through anyway because it also includesinformation detailing when each system vendor began shipping Perl.</p></dd><dt><b><em class="emphasis">scripts</em></b></dt><dd><p><a name="INDEX-3796"></a>This directory contains a small collection of diverse Perl programsfrom all over the world.  These are useful as standalone programs andperhaps as examples (although the code isn't subject to qualitycontrol checks).  Right now, there aren't many programs listed, but wehope this area will become richer in time.  The Perl Power Toolsproject (PPT) is also to be found here.  PPT aims to recreate all thestandard Unix utilities in Perl.  Most of the standard ones are donealready, plus some that aren't standard.</p></dd><dt><b><em class="emphasis">src</em></b></dt><dd><p><a name="INDEX-3797"></a><a name="INDEX-3798"></a>Within this directory, you will find the source code for the standardPerl distribution.  Actually, for two standard Perl distributions.  One is marked <em class="emphasis">stable</em>, and the other<em class="emphasis">devel</em>.  (The index page for this directory explainsthe details.)  These are really justlinks to the appropriate versions. As of this writing, <em class="emphasis">stable.tar.gz</em>is a symbolic link to <em class="emphasis">perl-5.6.0.tar.gz</em>,<a href="#FOOTNOTE-2">[2]</a> but it will likely point to a higher version numberby the time you read this.  This giant file contains thefull source code and documentation for Perl.  Configuration andinstallation should be relatively straightforward on most platforms. If not, see <em class="emphasis">ports</em> described earlier.</p><blockquote class="footnote"><a name="FOOTNOTE-2"></a><p>[2] The general scheme is that if the secondnumber in the version is even, it's a maintenance release; if it'sodd, it's a development release.  The trailing<em class="emphasis">.tar.gz</em> extension, which is sometimes written <em class="emphasis">.tgz</em>, indicates that it's in the standard Internet format of a GNU-zipped <em class="emphasis">tar</em>archive, commonly known as a "tarball".</p></blockquote></dd></dl><h2 class="sect1">22.1. The CPAN modules Directory</h2><p>Although CPAN contains the complete source code for Perl, plus a fewbinary distributions for systems bereft of C compilers, as well as a smattering of programs, CPAN is bestknown for its collection of modules.</p><p><a name="INDEX-3799"></a><a name="INDEX-3800"></a><a name="INDEX-3801"></a>When we say "modules", we mean three things: 100% pure Perl modules(described in <a href="ch11_01.htm">Chapter 11, "Modules"</a>, and <a href="ch12_01.htm">Chapter 12, "Objects"</a>),extensions (modules depending on C code, described in <a href="ch21_01.htm">Chapter 21, "Internals and Externals"</a>), and pragmas (modules containing specialinstructions for the Perl compiler, described in <a href="ch31_01.htm">Chapter 31, "Pragmatic Modules"</a>).  There are also module <em class="emphasis">bundles</em> on CPAN.Bundles are collections of modules that interoperate somehow andare typically the result of a module developer wanting to providea turnkey solution to a set of problems.  If one module depends onanother module (and possibly a particular version), developers willoften bundle the modules together.  See <tt class="literal">Bundle-XML</tt>, for instance.</p><p>One way to browse the CPAN modules is to visit <a href="http://search.cpan.org">http://search.cpan.org</a>,which provides a search engine frontend to CPAN.  Another way is tovisit your local CPAN mirror and enter the <em class="emphasis">modules</em> directory, whereyou'll see three subdirectories: <em class="emphasis">by-authors</em>, <em class="emphasis">by-category</em>, and<em class="emphasis">by-name</em>.  The <em class="emphasis">by-name</em> directory may be the most useful if your browser has search capabilities--although (lamentably) some modules are only available in the authordirectories.  If you search by category, you'll have the followingchoices:<a name="INDEX-3802"></a><a name="INDEX-3803"></a></p><dl><dt><b>Perl core modules, language extensions, and documentation tools</b></dt><dd><p><a name="INDEX-3804"></a><a name="INDEX-3805"></a><a name="INDEX-3806"></a><a name="INDEX-3807"></a><a name="INDEX-3808"></a><a name="INDEX-3809"></a>This includes pragmas and other standard modules, modulesthat help you write Perl differently, modules related to the Perlcompiler, source filters, and modules related to Perl's poddocumentation format.  This category also includes modules forgenerating Java bytecode.</p></dd><dt><b>Development support</b></dt><dd><p><a name="INDEX-3810"></a>This category includes modules for creating modules and examining howPerl runs programs.</p></dd><dt><b>Operating system interfaces and hardware drivers</b></dt><dd><p><a name="INDEX-3811"></a><a name="INDEX-3812"></a><a name="INDEX-3813"></a><a name="INDEX-3814"></a>Here you'll find modules for interacting with strange entities likeoperating systems, PalmPilots, and serial ports.</p></dd>

⌨️ 快捷键说明

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