📄 ch17_02.htm
字号:
</pre><p><a name="INDEX-2226" />Sets the current article pointer to theprevious article in the current newsgroup. Returns thearticle's message ID.</p></div><a name="INDEX-2227" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>list</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->list( )</pre><p><a name="INDEX-2227" />Returns information about all activenewsgroups. The result is a reference to a hash in which the key is anewsgroup name, and each value is a reference to an array. Theelements in the array are the first article number in the group, thelast article number in the group, and any information flags.</p></div><a name="INDEX-2228" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>listgroup</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->listgroup([<em class="replaceable">group</em>])</pre><p><a name="INDEX-2228" />Returns a reference to a list ofall active messages in newsgroup <em class="replaceable"><tt>group</tt></em>, orthe current newsgroup if <em class="replaceable"><tt>group</tt></em> is notspecified (an extension).</p></div><a name="INDEX-2229" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>newgroups</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->newgroups(<em class="replaceable">since</em>[, <em class="replaceable">distributions</em>])</pre><p><a name="INDEX-2229" />Like <tt class="literal">list</tt>, butreturns groups created after a certain time and optionally in one ofa set of distribution areas. Arguments are:</p><dl><dt><i><em class="replaceable"><tt>since</tt></em></i></dt><dd>Time value; only groups created after this time should be returned.</p></dd><dt><i><em class="replaceable"><tt>distributions</tt></em></i></dt><dd>Optional distribution pattern or reference to a list of distributionpatterns. If present, only groups matching a specified distributionarea should be returned.</p></dd></dl></div><a name="INDEX-2230" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>newnews</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->newnews(<em class="replaceable">since</em>[, <em class="replaceable">groups</em>[, <em class="replaceable">distributions</em>]])</pre><p><a name="INDEX-2230" />Returns a reference to a listcontaining the message IDs of all news posted after<em class="replaceable"><tt>since</tt></em> that are in newsgroups matching<em class="replaceable"><tt>groups</tt></em>, with a distribution that matches<em class="replaceable"><tt>distributions</tt></em>. Arguments are:</p><dl><dt><i><em class="replaceable"><tt>since</tt></em></i></dt><dd>Time value; only groups created after this time should be returned.</p></dd><dt><i><em class="replaceable"><tt>groups</tt></em></i></dt><dd>Optional group pattern or reference to a list of group patternsindicating which groups should be checked for new messages.</p></dd><dt><i><em class="replaceable"><tt>distributions</tt></em></i></dt><dd>Optional distribution pattern or reference to a list of distributionpatterns. If present, only groups matching a specified distributionarea should be returned.</p></dd></dl></div><a name="INDEX-2231" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>newsgroups</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->newsgroups([<em class="replaceable">pattern</em>])</pre><p><a name="INDEX-2231" />Returns a reference to a hash inwhich the keys are all newsgroup names that match<em class="replaceable"><tt>pattern</tt></em>, or all newsgroups if no patternis specified, and each value contains the description text for thegroup (an extension).</p></div><a name="INDEX-2232" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>next</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->next( )</pre><p><a name="INDEX-2232" />Sets the current article pointer to thenext article in the current newsgroup. Returns the message ID of thearticle.</p></div><a name="INDEX-2233" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>nntpstat</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->nntpstat([<em class="replaceable">msgid</em>|<em class="replaceable">msgnum</em>])</pre><p><a name="INDEX-2233" />Similar to<tt class="literal">article</tt>, except that no text is returned. Whenselecting by message number within a newsgroup, sets the currentarticle pointer without sending text. Selecting by message ID isvalid, but doesn't alter the current article pointerand therefore is of little use. Returns the message ID of the currentarticle.</p></div><a name="INDEX-2234" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>overview_fmt</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->overview_fmt( )</pre><p><a name="INDEX-2234" />Returns a reference to an arraycontaining the names of the fields returned by<tt class="literal">xover</tt> (an extension).</p></div><a name="INDEX-2235" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>post</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->post([<em class="replaceable">message</em>])</pre><p><a name="INDEX-2235" />Posts a new article to the newsserver. If <em class="replaceable"><tt>message</tt></em> is specified andposting is allowed, then the message is sent. If<em class="replaceable"><tt>message</tt></em> is not specified, the message mustbe sent using the Net::Cmd <tt class="literal">datasend</tt> and<tt class="literal">dataend</tt> methods.<em class="replaceable"><tt>message</tt></em> can be either an array of lines ora reference to an array.</p></div><a name="INDEX-2236" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>postok</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->postok( )</pre><p><a name="INDEX-2236" />Returns true if theserver's initial response indicated that it allowsposting.</p></div><a name="INDEX-2237" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>quit</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->quit( )</pre><p><a name="INDEX-2237" />Quits the remote server and closes thesocket connection.</p></div><a name="INDEX-2238" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>reader</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->reader( )</pre><p><a name="INDEX-2238" />Tells the server that you are areader and not another server; required by some servers (anextension).</p></div><a name="INDEX-2239" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>slave</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->slave( )</pre><p><a name="INDEX-2239" />Tells the remote server that thisis not a user client, but is probably another news server.</p></div><a name="INDEX-2240" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>subscriptions</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->subscriptions( )</pre><p><a name="INDEX-2240" />Returns a reference to a defaultlist of newsgroups recommended for new users to subscribe to (anextension).</p></div><a name="INDEX-2241" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>xgtitle</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->xgtitle(<em class="replaceable">pattern</em>)</pre><p><a name="INDEX-2241" />Returns a reference to a hash inwhich the keys are all the newsgroup names that match<em class="replaceable"><tt>pattern</tt></em>, and each value is the text of thenewsgroup's description (an extension).</p></div><a name="INDEX-2242" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>xhdr</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->xhdr(<em class="replaceable">header</em>, <em class="replaceable">message-spec</em>)</pre><p><a name="INDEX-2242" />Gets the header field<em class="replaceable"><tt>header</tt></em> for all the messages specified in<em class="replaceable"><tt>message-spec</tt></em>. Returns a reference to ahash in which the keys are the message numbers, and each valuecontains the text of the requested header for that message (anextension).</p></div><a name="INDEX-2243" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>xover</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->xover(<em class="replaceable">message-spec</em>)</pre><p><a name="INDEX-2243" />Returns a reference to a hash inwhich the keys are the message numbers, and each value contains areference to an array of the overview fields for that message (anextension).</p><p>The names of the fields can be obtained by calling<tt class="literal">overview_fmt</tt>.</p></div><a name="INDEX-2244" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>xpat</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->xpat(<em class="replaceable">header</em>, <em class="replaceable">pattern</em>, <em class="replaceable">message-spec</em>)</pre><p><a name="INDEX-2244" />Like <tt class="literal">xhdr</tt>, butreturns only headers in which the text of the header matches<em class="replaceable"><tt>pattern</tt></em> (an extension).</p></div><a name="INDEX-2245" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>xpath</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->xpath(<em class="replaceable">message-id</em>)</pre><p><a name="INDEX-2245" />Returns the path to the file onthe server that contains the specified message (an extension).</p></div><a name="INDEX-2246" /><a name="INDEX-2247" /><a name="INDEX-2248" /><a name="INDEX-2249" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>xrover</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>$<em class="replaceable">nntp</em>->xrover(<em class="replaceable">message-spec</em>)</pre><p><a name="INDEX-2246" />Returns reference information forthe article(s) specified. Returns a reference to a hash in which thekeys are the message numbers, and the values are the<tt class="literal">References</tt>: lines from the articles (anextension).<a name="INDEX-2247" /><a name="INDEX-2248" /><a name="INDEX-2249" /></p></div></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch17_01.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch17_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">17. Usenet News</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">17.3. The News::Newsrc Module</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright © 2002</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,85,94" href="../index.htm"><area shape="rect" coords="86,1,178,103" href="../lwp/index.htm"><area shape="rect" coords="180,0,265,103" href="../lperl/index.htm"><area shape="rect" coords="267,0,353,105" href="../perlnut/index.htm"><area shape="rect" coords="354,1,446,115" href="../prog/index.htm"><area shape="rect" coords="448,0,526,132" href="../tk/index.htm"><area shape="rect" coords="528,1,615,119" href="../cookbook/index.htm"><area shape="rect" coords="617,0,690,135" href="../pxml/index.htm"></map></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -