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

📄 ch00_04.htm

📁 编程珍珠,里面很多好用的代码,大家可以参考学习呵呵,
💻 HTM
字号:
<html><head><title>Online Documentation (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="Online Documentation"><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="ch00_03.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="ch00_01.htm">Preface</a></td><td align="right" valign="top" width="172"><a href="ch00_05.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr></table></div><hr width="515" align="left"><!-- SECTION BODY --><h2 class="sect1">0.4. Online Documentation</h2><a name="INDEX-5"></a><a name="INDEX-6"></a><a name="INDEX-7"></a><a name="INDEX-8"></a><p>Perl's extensive online documentation comes as part of the standardPerl distribution.  (See the next section for offline documentation.)Additional documentation shows up whenever you install a modulefrom CPAN.</p><p>When we refer to a "Perl manpage" in this book, we're talking aboutthis set of online Perl manual pages, sitting on your computer.  Theterm <em class="emphasis">manpage</em> is purely a convention meaning a file containingdocumentation--you don't need a Unix-style <em class="emphasis">man</em> program to read one.You may even have the Perl manpages installed as HTML pages, especiallyon non-Unix systems.</p><p>The online manpages for Perl have been divided into separate sections,so you can easily find what you are looking for without wading throughhundreds of pages of text.  Since the top-level manpage is simplycalled <em class="emphasis">perl</em>, the Unix command <em class="emphasis">man perl</em> should take you toit.<a href="#FOOTNOTE-1">[1]</a> That page in turn directs you to morespecific pages.  For example, <em class="emphasis">man perlre</em> will display the manpagefor Perl's regular expressions.  The <em class="emphasis">perldoc</em> command often works onsystems when the <em class="emphasis">man</em> command won't.  On Macs, you need to use the<em class="emphasis">Shuck</em> program.  Your port may also provide the Perl manpages in HTMLformat or your system's native help format.  Check with yourlocal sysadmin--unless you're the local sysadmin.</p><blockquote class="footnote"><a name="FOOTNOTE-1"></a><p>[1] If you still get a truly humongous page when you do that,you're probably picking up the ancient release 4 manpage.  Check your<tt class="literal">MANPATH</tt> for archeological sites.  (Say <em class="emphasis">perldoc perl</em> to find outhow to configure your <tt class="literal">MANPATH</tt> based on the output of <em class="emphasis">perl-V:man.dir</em>.)</p></blockquote><h3 class="sect2">0.4.1. Navigating the Standard Manpages</h3><p>In the Beginning (of Perl, that is, back in 1987), the <em class="emphasis">perl</em> manpagewas a terse document, filling about 24 pages when typeset andprinted.  For example, its section on regular expressions was only twoparagraphs long.  (That was enough, if you knew <em class="emphasis">egrep</em>.)  In someways, nearly everything has changed since then.  Counting the standarddocumentation, the various utilities, the per-platform portinginformation, and the scads of standard modules, we're now up over 1,500typeset pages of documentation spread across many separate manpages.(And that's not even counting any CPAN modules you install, which is likelyto be quite a few.)</p><p>But in other ways, nothing has changed: there's still a <em class="emphasis">perl</em> manpagekicking around.  And it's still the right place to start when you don'tknow where to start.  The difference is that once you arrive, you can'tjust stop there.  Perl documentation is no longer a cottage industry;it's a supermall with hundreds of stores.  When you walk in the door,you need to find the YOU ARE HERE to figure out which shop ordepartment store sells what you're shopping for.  Of course, once youget familiar with the mall, you'll usually know right where to go.</p><p>Here are a few of the store signs you'll see:</p><a name="perl3-tab-perlmans"></a><table border="1"><tr><th>Manpage</th><th>Covers</th></tr><tr><td><em class="emphasis">perl</em></td><td>What Perl manpages are available</td></tr><tr><td><em class="emphasis">perldata</em></td><td>Data types</td></tr><tr><td><em class="emphasis">perlsyn</em></td><td>Syntax</td></tr><tr><td><em class="emphasis">perlop</em></td><td>Operators and precedence</td></tr><tr><td><em class="emphasis">perlre</em></td><td>Regular expressions</td></tr><tr><td><em class="emphasis">perlvar</em></td><td>Predefined variables</td></tr><tr><td><em class="emphasis">perlsub</em></td><td>Subroutines</td></tr><tr><td><em class="emphasis">perlfunc</em></td><td>Built-in functions</td></tr><tr><td><em class="emphasis">perlmod</em></td><td>How to make Perl modules work</td></tr><tr><td><em class="emphasis">perlref</em></td><td>References</td></tr><tr><td><em class="emphasis">perlobj</em></td><td>Objects</td></tr><tr><td><em class="emphasis">perlipc</em></td><td>Interprocess communication</td></tr><tr><td><em class="emphasis">perlrun</em></td><td>How to run Perl commands, plus switches</td></tr><tr><td><em class="emphasis">perldebug</em></td><td>Debugging</td></tr><tr><td><em class="emphasis">perldiag</em></td><td>Diagnostic messages</td></tr></table><p>That's just a small excerpt, but it has the important parts.  Youcan tell that if you want to learn about an operator, <em class="emphasis">perlop</em>is apt to have what you're looking for.  And if you want to findsomething out about predefined variables, you'd check in <em class="emphasis">perlvar</em>.If you got a diagnostic message you didn't understand, you'd go to<em class="emphasis">perldiag</em>.  And so on.</p><p>Part of the standard Perl manual is the frequently asked questions(FAQ) list.  It's split up into these nine different pages:</p><a name="perl3-tab-perlfaqs"></a><table border="1"><tr><th>Manpage</th><th>Covers</th></tr><tr><td><em class="emphasis">perlfaq1</em></td><td>General questions about Perl</td></tr><tr><td><em class="emphasis">perlfaq2</em></td><td>Obtaining and learning about Perl</td></tr><tr><td><em class="emphasis">perlfaq3</em></td><td>Programming tools</td></tr><tr><td><em class="emphasis">perlfaq4</em></td><td>Data manipulation</td></tr><tr><td><em class="emphasis">perlfaq5</em></td><td>Files and formats</td></tr><tr><td><em class="emphasis">perlfaq6</em></td><td>Regular expressions</td></tr><tr><td><em class="emphasis">perlfaq7</em></td><td>General Perl language issues</td></tr><tr><td><em class="emphasis">perlfaq8</em></td><td>System interaction</td></tr><tr><td><em class="emphasis">perlfaq9</em></td><td>Networking</td></tr></table><p>Some manpages contain platform-specific notes:</p><a name="perl3-tab-perlports"></a><table border="1"><tr><th>Manpage</th><th>Covers</th></tr><tr><td><em class="emphasis">perlamiga</em></td><td>The Amiga port</td></tr><tr><td><em class="emphasis">perlcygwin</em></td><td>The Cygwin port</td></tr><tr><td><em class="emphasis">perldos</em></td><td>The MS-DOS port</td></tr><tr><td><em class="emphasis">perlhpux</em></td><td>The HP-UX port</td></tr><tr><td><em class="emphasis">perlmachten</em></td><td>The Power MachTen port</td></tr><tr><td><em class="emphasis">perlos2</em></td><td>The OS/2 port</td></tr><tr><td><em class="emphasis">perlos390</em></td><td>The OS/390 port</td></tr><tr><td><em class="emphasis">perlvms</em></td><td>The DEC VMS port</td></tr><tr><td><em class="emphasis">perlwin32</em></td><td>The MS-Windows port</td></tr></table><p>(See also <a href="ch25_01.htm">Chapter 25, "Portable Perl"</a>, and the CPAN <em class="emphasis">ports</em>directory described earlier for porting information.)</p><h3 class="sect2">0.4.2. Searching the Manpages</h3><p>Nobody expects you to read through all 1,500 typeset pages just tofind a needle in a haystack.  There's an old saying that you can't<em class="emphasis">grep</em><a href="#FOOTNOTE-2">[2]</a> dead trees.  Besides thecustomary search capabilities inherent in most document-viewingprograms, as of the 5.6.1 release of Perl, each main Perl manpage hasits own search and display capability.  You can search individualpages by using the name of the manpage as the command and passing aPerl regular expression (see <a href="ch05_01.htm">Chapter 5, "Pattern Matching"</a>) as the search pattern:<blockquote><pre class="programlisting">% <tt class="userinput"><b>perlop comma</b></tt>% <tt class="userinput"><b>perlfunc split</b></tt>% <tt class="userinput"><b>perlvar ARGV</b></tt>% <tt class="userinput"><b>perldiag 'assigned to typeglob'</b></tt></pre></blockquote>When you don't quite know where something is in the documentation,you can expand your search.  For example, to search all the FAQs,use the <em class="emphasis">perlfaq</em> command (which is also a manpage):<blockquote><pre class="programlisting">% <tt class="userinput"><b>perlfaq round</b></tt></pre></blockquote>The <em class="emphasis">perltoc</em> command (which is also a manpage)searches all the manpages' collective tables of contents:<blockquote><pre class="programlisting">% <tt class="userinput"><b>perltoc typeglob</b></tt>perl5005delta: Undefined value assigned to typeglobperldata: Typeglobs and Filehandlesperldiag: Undefined value assigned to typeglob</pre></blockquote>Or to search the complete online Perl manual, including all headers,descriptions, and examples, for any instances of the string, use the<em class="emphasis">perlhelp</em> command:<blockquote><pre class="programlisting">% <tt class="userinput"><b>perlhelp CORE::GLOBA</b></tt>L</pre></blockquote>See the <em class="emphasis">perldoc</em> manpage for details.</p><blockquote class="footnote"><a name="FOOTNOTE-2"></a><p>[2]Don't forget there'sa Glossary if you need it.</p></blockquote><h3 class="sect2">0.4.3. Non-Perl Manpages</h3><p>When we refer to non-Perl documentation, as in <em class="emphasis">getitimer</em>(2), thisrefers to the <em class="emphasis">getitimer</em> manpage from section 2 of the<em class="emphasis">Unix Programmer's Manual</em>.<a href="#FOOTNOTE-3">[3]</a> Manpages for syscalls such as <em class="emphasis">getitimer</em> may notbe available on non-Unix systems, but that's probably okay, because youcouldn't use the Unix syscall there anyway.  If you really do need thedocumentation for a Unix command, syscall, or library function, manyorganizations have put their manpages on the web--a quick search ofAltaVista for "+crypt(3)&nbsp;+manual" will find many copies.</p><blockquote class="footnote"><a name="FOOTNOTE-3"></a><p>[3]Section 2 is only supposed to containdirect calls into the operating system. (These are often called "systemcalls", but we'll consistently call them <em class="emphasis">syscalls</em> in this book toavoid confusion with the <tt class="literal">system</tt> function, which has nothing to dowith syscalls).  However, systems vary somewhat in which calls areimplemented as syscalls and which are implemented as C library calls,so you could conceivably find <em class="emphasis">getitimer</em>(2) in section 3instead.</p></blockquote><p>Although the top-level Perl manpages are typically installed in section1 of the standard <em class="emphasis">man</em> directories, we will omit appending a(1) to those manpage names in this book.  You can recognize them anywaybecause they are all of the form "<tt class="literal">perl</tt><em class="replaceable">mumble</em>".</p><!-- BOTTOM NAV BAR --><hr width="515" align="left"><div class="navbar"><table width="515" border="0"><tr><td align="left" valign="top" width="172"><a href="ch00_03.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0"></a></td><td align="right" valign="top" width="172"><a href="ch00_05.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr><tr><td align="left" valign="top" width="172">0.3. The Standard Distribution</td><td align="center" valign="top" width="171"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0"></a></td><td align="right" valign="top" width="172">0.5. Offline Documentation</td></tr></table></div><hr width="515" align="left"><!-- LIBRARY NAV BAR --><img src="../gifs/smnavbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links"><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2001</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"> <area shape="rect" coords="2,-1,79,99" href="../index.htm"><area shape="rect" coords="84,1,157,108" href="../perlnut/index.htm"><area shape="rect" coords="162,2,248,125" href="../prog/index.htm"><area shape="rect" coords="253,2,326,130" href="../advprog/index.htm"><area shape="rect" coords="332,1,407,112" href="../cookbook/index.htm"><area shape="rect" coords="414,2,523,103" href="../sysadmin/index.htm"></map><!-- END OF BODY --></body></html>

⌨️ 快捷键说明

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