CINXE.COM

Net::NNTP - NNTP Client class - Perldoc Browser

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Net::NNTP - NNTP Client class - Perldoc Browser</title> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser"> <link rel="canonical" href="https://perldoc.perl.org/Net::NNTP"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" /> <style> body { background: #f4f4f5; color: #020202; } .navbar-dark { background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%); background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%); background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0); background-repeat: repeat-x; } .navbar-dark .navbar-nav .nav-link, .navbar-dark .navbar-nav .nav-link:focus { color: #fff } .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 } #wrapperlicious { margin: 0 auto; font: 0.9em 'Helvetica Neue', Helvetica, sans-serif; font-weight: normal; line-height: 1.5em; margin: 0; padding: 0; } #wrapperlicious h1 { font-size: 1.5em } #wrapperlicious h2 { font-size: 1.3em } #wrapperlicious h3 { font-size: 1.1em } #wrapperlicious h4 { font-size: 0.9em } #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3, #wrapperlicious h4, #wrapperlicious dt { color: #020202; margin-top: 1em; margin-bottom: 1em; position: relative; font-weight: bold; } #wrapperlicious a { color: inherit; text-decoration: underline } #wrapperlicious #toc { text-decoration: none } #wrapperlicious a:hover { color: #2a2a2a } #wrapperlicious a img { border: 0 } #wrapperlicious :not(pre) > code { color: inherit; background-color: rgba(0, 0, 0, 0.04); border-radius: 3px; font: 0.9em Consolas, Menlo, Monaco, monospace; padding: 0.3em; } #wrapperlicious dd { margin: 0; margin-left: 2em; } #wrapperlicious dt { color: #2a2a2a; font-weight: bold; margin-left: 0.9em; } #wrapperlicious p { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious li > p { margin-bottom: 0; margin-top: 0; } #wrapperlicious pre { border: 1px solid #c1c1c1; border-radius: 3px; font: 100% Consolas, Menlo, Monaco, monospace; margin-bottom: 1em; margin-top: 1em; } #wrapperlicious pre > code { display: block; background-color: #f6f6f6; font: 0.9em Consolas, Menlo, Monaco, monospace; line-height: 1.5em; text-align: left; white-space: pre; padding: 1em; } #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious ul { list-style-type: square; } #wrapperlicious ul ul { margin-bottom: 0px; margin-top: 0px; } #footer { font-size: 0.8em; padding-top: 0.5em; text-align: center; } #more { display: inline; font-size: 0.8em; } #perldocdiv { background-color: #fff; border: 1px solid #c1c1c1; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; margin-left: auto; margin-right: auto; padding: 3em; padding-top: 1em; max-width: 960px; } #moduleversion { float: right } #wrapperlicious .leading-notice { font-style: italic; padding-left: 1em; margin-top: 1em; margin-bottom: 1em; } #wrapperlicious .permalink { display: none; left: -0.75em; position: absolute; padding-right: 0.25em; text-decoration: none; } #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink, #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink, #wrapperlicious dt:hover .permalink { display: block; } </style> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KVNWBNT5FB'); gtag('config', 'UA-50555-3'); </script> </head> <body> <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="/"><img src="/images/perl_camel_30.png" width="30" height="30" class="d-inline-block align-top" alt="Perl Camel Logo"> Perldoc Browser</a> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.8.1</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-stable"> <a class="dropdown-item" href="/Net::NNTP">Latest</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1/Net::NNTP">5.40.1</a> <a class="dropdown-item" href="/5.40.0/Net::NNTP">5.40.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3/Net::NNTP">5.38.3</a> <a class="dropdown-item" href="/5.38.2/Net::NNTP">5.38.2</a> <a class="dropdown-item" href="/5.38.1/Net::NNTP">5.38.1</a> <a class="dropdown-item" href="/5.38.0/Net::NNTP">5.38.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.36.3/Net::NNTP">5.36.3</a> <a class="dropdown-item" href="/5.36.2/Net::NNTP">5.36.2</a> <a class="dropdown-item" href="/5.36.1/Net::NNTP">5.36.1</a> <a class="dropdown-item" href="/5.36.0/Net::NNTP">5.36.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.34.3/Net::NNTP">5.34.3</a> <a class="dropdown-item" href="/5.34.2/Net::NNTP">5.34.2</a> <a class="dropdown-item" href="/5.34.1/Net::NNTP">5.34.1</a> <a class="dropdown-item" href="/5.34.0/Net::NNTP">5.34.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.32.1/Net::NNTP">5.32.1</a> <a class="dropdown-item" href="/5.32.0/Net::NNTP">5.32.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.30.3/Net::NNTP">5.30.3</a> <a class="dropdown-item" href="/5.30.2/Net::NNTP">5.30.2</a> <a class="dropdown-item" href="/5.30.1/Net::NNTP">5.30.1</a> <a class="dropdown-item" href="/5.30.0/Net::NNTP">5.30.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.28.3/Net::NNTP">5.28.3</a> <a class="dropdown-item" href="/5.28.2/Net::NNTP">5.28.2</a> <a class="dropdown-item" href="/5.28.1/Net::NNTP">5.28.1</a> <a class="dropdown-item" href="/5.28.0/Net::NNTP">5.28.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.26.3/Net::NNTP">5.26.3</a> <a class="dropdown-item" href="/5.26.2/Net::NNTP">5.26.2</a> <a class="dropdown-item" href="/5.26.1/Net::NNTP">5.26.1</a> <a class="dropdown-item" href="/5.26.0/Net::NNTP">5.26.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.24.4/Net::NNTP">5.24.4</a> <a class="dropdown-item" href="/5.24.3/Net::NNTP">5.24.3</a> <a class="dropdown-item" href="/5.24.2/Net::NNTP">5.24.2</a> <a class="dropdown-item" href="/5.24.1/Net::NNTP">5.24.1</a> <a class="dropdown-item" href="/5.24.0/Net::NNTP">5.24.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.22.4/Net::NNTP">5.22.4</a> <a class="dropdown-item" href="/5.22.3/Net::NNTP">5.22.3</a> <a class="dropdown-item" href="/5.22.2/Net::NNTP">5.22.2</a> <a class="dropdown-item" href="/5.22.1/Net::NNTP">5.22.1</a> <a class="dropdown-item" href="/5.22.0/Net::NNTP">5.22.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.20.3/Net::NNTP">5.20.3</a> <a class="dropdown-item" href="/5.20.2/Net::NNTP">5.20.2</a> <a class="dropdown-item" href="/5.20.1/Net::NNTP">5.20.1</a> <a class="dropdown-item" href="/5.20.0/Net::NNTP">5.20.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.18.4/Net::NNTP">5.18.4</a> <a class="dropdown-item" href="/5.18.3/Net::NNTP">5.18.3</a> <a class="dropdown-item" href="/5.18.2/Net::NNTP">5.18.2</a> <a class="dropdown-item" href="/5.18.1/Net::NNTP">5.18.1</a> <a class="dropdown-item" href="/5.18.0/Net::NNTP">5.18.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.16.3/Net::NNTP">5.16.3</a> <a class="dropdown-item" href="/5.16.2/Net::NNTP">5.16.2</a> <a class="dropdown-item" href="/5.16.1/Net::NNTP">5.16.1</a> <a class="dropdown-item" href="/5.16.0/Net::NNTP">5.16.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.14.4/Net::NNTP">5.14.4</a> <a class="dropdown-item" href="/5.14.3/Net::NNTP">5.14.3</a> <a class="dropdown-item" href="/5.14.2/Net::NNTP">5.14.2</a> <a class="dropdown-item" href="/5.14.1/Net::NNTP">5.14.1</a> <a class="dropdown-item" href="/5.14.0/Net::NNTP">5.14.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.12.5/Net::NNTP">5.12.5</a> <a class="dropdown-item" href="/5.12.4/Net::NNTP">5.12.4</a> <a class="dropdown-item" href="/5.12.3/Net::NNTP">5.12.3</a> <a class="dropdown-item" href="/5.12.2/Net::NNTP">5.12.2</a> <a class="dropdown-item" href="/5.12.1/Net::NNTP">5.12.1</a> <a class="dropdown-item" href="/5.12.0/Net::NNTP">5.12.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.10.1/Net::NNTP">5.10.1</a> <a class="dropdown-item" href="/5.10.0/Net::NNTP">5.10.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.9/Net::NNTP">5.8.9</a> <a class="dropdown-item" href="/5.8.8/Net::NNTP">5.8.8</a> <a class="dropdown-item" href="/5.8.7/Net::NNTP">5.8.7</a> <a class="dropdown-item" href="/5.8.6/Net::NNTP">5.8.6</a> <a class="dropdown-item" href="/5.8.5/Net::NNTP">5.8.5</a> <a class="dropdown-item" href="/5.8.4/Net::NNTP">5.8.4</a> <a class="dropdown-item" href="/5.8.3/Net::NNTP">5.8.3</a> <a class="dropdown-item" href="/5.8.2/Net::NNTP">5.8.2</a> <a class="dropdown-item active" href="/5.8.1/Net::NNTP">5.8.1</a> <a class="dropdown-item" href="/5.8.0/Net::NNTP">5.8.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/Net::NNTP">5.6.2</a> <a class="dropdown-item" href="/5.6.1/Net::NNTP">5.6.1</a> <a class="dropdown-item" href="/5.6.0/Net::NNTP">5.6.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.005_04/Net::NNTP">5.005_04</a> <a class="dropdown-item" href="/5.005_03/Net::NNTP">5.005_03</a> <a class="dropdown-item" href="/5.005_02/Net::NNTP">5.005_02</a> <a class="dropdown-item" href="/5.005_01/Net::NNTP">5.005_01</a> <a class="dropdown-item" href="/5.005/Net::NNTP">5.005</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-dev"> <a class="dropdown-item" href="/blead/Net::NNTP">blead</a> <a class="dropdown-item" href="/5.41.10/Net::NNTP">5.41.10</a> <a class="dropdown-item" href="/5.41.9/Net::NNTP">5.41.9</a> <a class="dropdown-item" href="/5.41.8/Net::NNTP">5.41.8</a> <a class="dropdown-item" href="/5.41.7/Net::NNTP">5.41.7</a> <a class="dropdown-item" href="/5.41.6/Net::NNTP">5.41.6</a> <a class="dropdown-item" href="/5.41.5/Net::NNTP">5.41.5</a> <a class="dropdown-item" href="/5.41.4/Net::NNTP">5.41.4</a> <a class="dropdown-item" href="/5.41.3/Net::NNTP">5.41.3</a> <a class="dropdown-item" href="/5.41.2/Net::NNTP">5.41.2</a> <a class="dropdown-item" href="/5.41.1/Net::NNTP">5.41.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1-RC1/Net::NNTP">5.40.1-RC1</a> <a class="dropdown-item" href="/5.40.0-RC2/Net::NNTP">5.40.0-RC2</a> <a class="dropdown-item" href="/5.40.0-RC1/Net::NNTP">5.40.0-RC1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.39.10/Net::NNTP">5.39.10</a> <a class="dropdown-item" href="/5.39.9/Net::NNTP">5.39.9</a> <a class="dropdown-item" href="/5.39.8/Net::NNTP">5.39.8</a> <a class="dropdown-item" href="/5.39.7/Net::NNTP">5.39.7</a> <a class="dropdown-item" href="/5.39.6/Net::NNTP">5.39.6</a> <a class="dropdown-item" href="/5.39.5/Net::NNTP">5.39.5</a> <a class="dropdown-item" href="/5.39.4/Net::NNTP">5.39.4</a> <a class="dropdown-item" href="/5.39.3/Net::NNTP">5.39.3</a> <a class="dropdown-item" href="/5.39.2/Net::NNTP">5.39.2</a> <a class="dropdown-item" href="/5.39.1/Net::NNTP">5.39.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3-RC1/Net::NNTP">5.38.3-RC1</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-nav"> <a class="dropdown-item" href="/5.8.1/perl">Perl</a> <a class="dropdown-item" href="/5.8.1/perlintro">Intro</a> <a class="dropdown-item" href="/5.8.1/perl#Tutorials">Tutorials</a> <a class="dropdown-item" href="/5.8.1/perlfaq">FAQs</a> <a class="dropdown-item" href="/5.8.1/perl#Reference-Manual">Reference</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.1/perlop">Operators</a> <a class="dropdown-item" href="/5.8.1/functions">Functions</a> <a class="dropdown-item" href="/5.8.1/variables">Variables</a> <a class="dropdown-item" href="/5.8.1/modules">Modules</a> <a class="dropdown-item" href="/5.8.1/perlutil">Utilities</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.1/perldelta">Release Notes</a> <a class="dropdown-item" href="/5.8.1/perlcommunity">Community</a> <a class="dropdown-item" href="/5.8.1/perlhist">History</a> </div> </li> </ul> <ul class="navbar-nav"> <script> function set_expand (expand) { var perldocdiv = document.getElementById('perldocdiv'); var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width'); var expanded = (width == '' || width == 'none') ? true : false; if (expand === null) { expand = !expanded; } if ((expand && !expanded) || (!expand && expanded)) { perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px'); var button_classlist = document.getElementById('content-expand-button').classList; if (expand) { button_classlist.add('btn-light'); button_classlist.remove('btn-outline-light'); } else { button_classlist.add('btn-outline-light'); button_classlist.remove('btn-light'); } } return expand; } function toggle_expand () { var expand = set_expand(null); document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC'; } function read_expand () { return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { if (read_expand()) { set_expand(true); } }); } else if (read_expand()) { set_expand(true); } </script> <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-4" onclick="toggle_expand()">Expand</button> </ul> <form class="form-inline" method="get" action="/5.8.1/search"> <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search" value=""> </form> </div> </nav> <div id="wrapperlicious" class="container-fluid"> <div id="perldocdiv"> <div id="links"> <a href="/5.8.1/Net::NNTP">Net::NNTP</a> <div id="more"> (<a href="/5.8.1/Net::NNTP.txt">source</a>, <a href="https://metacpan.org/pod/Net::NNTP">CPAN</a>) </div> <div id="moduleversion">version 2.22</div> </div> <div class="leading-notice"> You are viewing the version of this documentation from Perl 5.8.1. <a href="/Net::NNTP">View the latest version</a> </div> <h1><a id="toc">CONTENTS</a></h1> <ul> <li> <a class="text-decoration-none" href="#NAME">NAME</a> </li> <li> <a class="text-decoration-none" href="#SYNOPSIS">SYNOPSIS</a> </li> <li> <a class="text-decoration-none" href="#DESCRIPTION">DESCRIPTION</a> </li> <li> <a class="text-decoration-none" href="#CONSTRUCTOR">CONSTRUCTOR</a> </li> <li> <a class="text-decoration-none" href="#METHODS">METHODS</a> <ul> <li> <a class="text-decoration-none" href="#Extension-methods">Extension methods</a> </li> </ul> </li> <li> <a class="text-decoration-none" href="#UNSUPPORTED">UNSUPPORTED</a> </li> <li> <a class="text-decoration-none" href="#DEFINITIONS">DEFINITIONS</a> </li> <li> <a class="text-decoration-none" href="#SEE-ALSO">SEE ALSO</a> </li> <li> <a class="text-decoration-none" href="#AUTHOR">AUTHOR</a> </li> <li> <a class="text-decoration-none" href="#COPYRIGHT">COPYRIGHT</a> </li> </ul> <h1 id="NAME"><a class="permalink" href="#NAME">#</a>NAME</h1> <p>Net::NNTP - NNTP Client class</p> <h1 id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">#</a>SYNOPSIS</h1> <pre><code>use Net::NNTP; $nntp = Net::NNTP-&gt;new(&quot;some.host.name&quot;); $nntp-&gt;quit;</code></pre> <h1 id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">#</a>DESCRIPTION</h1> <p><code>Net::NNTP</code> is a class implementing a simple NNTP client in Perl as described in RFC977. <code>Net::NNTP</code> inherits its communication methods from <code>Net::Cmd</code></p> <h1 id="CONSTRUCTOR"><a class="permalink" href="#CONSTRUCTOR">#</a>CONSTRUCTOR</h1> <dl> <dt id="new-(-[-HOST-]-[,-OPTIONS-])"><a class="permalink" href="#new-(-%5B-HOST-%5D-%5B,-OPTIONS-%5D)">#</a><a id="new"></a><a id="new-HOST-OPTIONS"></a>new ( [ HOST ] [, OPTIONS ])</dt> <dd> <p>This is the constructor for a new Net::NNTP object. <code>HOST</code> is the name of the remote host to which a NNTP connection is required. If not given two environment variables are checked, first <code>NNTPSERVER</code> then <code>NEWSHOST</code>, then <code>Net::Config</code> is checked, and if a host is not found then <code>news</code> is used.</p> <p><code>OPTIONS</code> are passed in a hash like fashion, using key and value pairs. Possible options are:</p> <p><b>Timeout</b> - Maximum time, in seconds, to wait for a response from the NNTP server, a value of zero will cause all IO operations to block. (default: 120)</p> <p><b>Debug</b> - Enable the printing of debugging information to STDERR</p> <p><b>Reader</b> - If the remote server is INN then initially the connection will be to nnrpd, by default <code>Net::NNTP</code> will issue a <code>MODE READER</code> command so that the remote server becomes innd. If the <code>Reader</code> option is given with a value of zero, then this command will not be sent and the connection will be left talking to nnrpd.</p> </dd> </dl> <h1 id="METHODS"><a class="permalink" href="#METHODS">#</a>METHODS</h1> <p>Unless otherwise stated all methods return either a <i>true</i> or <i>false</i> value, with <i>true</i> meaning that the operation was a success. When a method states that it returns a value, failure will be returned as <i>undef</i> or an empty list.</p> <dl> <dt id="article-(-[-MSGID|MSGNUM-],-[FH]-)"><a class="permalink" href="#article-(-%5B-MSGID%7CMSGNUM-%5D,-%5BFH%5D-)">#</a><a id="article"></a><a id="article-MSGID-MSGNUM-FH"></a>article ( [ MSGID|MSGNUM ], [FH] )</dt> <dd> <p>Retrieve the header, a blank line, then the body (text) of the specified article.</p> <p>If <code>FH</code> is specified then it is expected to be a valid filehandle and the result will be printed to it, on success a true value will be returned. If <code>FH</code> is not specified then the return value, on success, will be a reference to an array containg the article requested, each entry in the array will contain one line of the article.</p> <p>If no arguments are passed then the current article in the currently selected newsgroup is fetched.</p> <p><code>MSGNUM</code> is a numeric id of an article in the current newsgroup, and will change the current article pointer. <code>MSGID</code> is the message id of an article as shown in that article&#39;s header. It is anticipated that the client will obtain the <code>MSGID</code> from a list provided by the <code>newnews</code> command, from references contained within another article, or from the message-id provided in the response to some other commands.</p> <p>If there is an error then <code>undef</code> will be returned.</p> </dd> <dt id="body-(-[-MSGID|MSGNUM-],-[FH]-)"><a class="permalink" href="#body-(-%5B-MSGID%7CMSGNUM-%5D,-%5BFH%5D-)">#</a><a id="body"></a><a id="body-MSGID-MSGNUM-FH"></a>body ( [ MSGID|MSGNUM ], [FH] )</dt> <dd> <p>Like <code>article</code> but only fetches the body of the article.</p> </dd> <dt id="head-(-[-MSGID|MSGNUM-],-[FH]-)"><a class="permalink" href="#head-(-%5B-MSGID%7CMSGNUM-%5D,-%5BFH%5D-)">#</a><a id="head"></a><a id="head-MSGID-MSGNUM-FH"></a>head ( [ MSGID|MSGNUM ], [FH] )</dt> <dd> <p>Like <code>article</code> but only fetches the headers for the article.</p> </dd> <dt id="articlefh-(-[-MSGID|MSGNUM-]-)"><a class="permalink" href="#articlefh-(-%5B-MSGID%7CMSGNUM-%5D-)">#</a><a id="articlefh"></a><a id="articlefh-MSGID-MSGNUM"></a>articlefh ( [ MSGID|MSGNUM ] )</dt> <dd> </dd> <dt id="bodyfh-(-[-MSGID|MSGNUM-]-)"><a class="permalink" href="#bodyfh-(-%5B-MSGID%7CMSGNUM-%5D-)">#</a><a id="bodyfh"></a><a id="bodyfh-MSGID-MSGNUM"></a>bodyfh ( [ MSGID|MSGNUM ] )</dt> <dd> </dd> <dt id="headfh-(-[-MSGID|MSGNUM-]-)"><a class="permalink" href="#headfh-(-%5B-MSGID%7CMSGNUM-%5D-)">#</a><a id="headfh"></a><a id="headfh-MSGID-MSGNUM"></a>headfh ( [ MSGID|MSGNUM ] )</dt> <dd> <p>These are similar to article(), body() and head(), but rather than returning the requested data directly, they return a tied filehandle from which to read the article.</p> </dd> <dt id="nntpstat-(-[-MSGID|MSGNUM-]-)"><a class="permalink" href="#nntpstat-(-%5B-MSGID%7CMSGNUM-%5D-)">#</a><a id="nntpstat"></a><a id="nntpstat-MSGID-MSGNUM"></a>nntpstat ( [ MSGID|MSGNUM ] )</dt> <dd> <p>The <code>nntpstat</code> command is similar to the <code>article</code> command except that no text is returned. When selecting by message number within a group, the <code>nntpstat</code> command serves to set the &quot;current article pointer&quot; without sending text.</p> <p>Using the <code>nntpstat</code> command to select by message-id is valid but of questionable value, since a selection by message-id does <b>not</b> alter the &quot;current article pointer&quot;.</p> <p>Returns the message-id of the &quot;current article&quot;.</p> </dd> <dt id="group-(-[-GROUP-]-)"><a class="permalink" href="#group-(-%5B-GROUP-%5D-)">#</a><a id="group"></a><a id="group-GROUP"></a>group ( [ GROUP ] )</dt> <dd> <p>Set and/or get the current group. If <code>GROUP</code> is not given then information is returned on the current group.</p> <p>In a scalar context it returns the group name.</p> <p>In an array context the return value is a list containing, the number of articles in the group, the number of the first article, the number of the last article and the group name.</p> </dd> <dt id="ihave-(-MSGID-[,-MESSAGE-])"><a class="permalink" href="#ihave-(-MSGID-%5B,-MESSAGE-%5D)">#</a><a id="ihave"></a><a id="ihave-MSGID-MESSAGE"></a>ihave ( MSGID [, MESSAGE ])</dt> <dd> <p>The <code>ihave</code> command informs the server that the client has an article whose id is <code>MSGID</code>. If the server desires a copy of that article, and <code>MESSAGE</code> has been given the it will be sent.</p> <p>Returns <i>true</i> if the server desires the article and <code>MESSAGE</code> was successfully sent,if specified.</p> <p>If <code>MESSAGE</code> is not specified then the message must be sent using the <code>datasend</code> and <code>dataend</code> methods from <a href="/5.8.1/Net::Cmd">Net::Cmd</a></p> <p><code>MESSAGE</code> can be either an array of lines or a reference to an array.</p> </dd> <dt id="last-()"><a class="permalink" href="#last-()">#</a><a id="last"></a>last ()</dt> <dd> <p>Set the &quot;current article pointer&quot; to the previous article in the current newsgroup.</p> <p>Returns the message-id of the article.</p> </dd> <dt id="date-()"><a class="permalink" href="#date-()">#</a><a id="date"></a>date ()</dt> <dd> <p>Returns the date on the remote server. This date will be in a UNIX time format (seconds since 1970)</p> </dd> <dt id="postok-()"><a class="permalink" href="#postok-()">#</a><a id="postok"></a>postok ()</dt> <dd> <p><code>postok</code> will return <i>true</i> if the servers initial response indicated that it will allow posting.</p> </dd> <dt id="authinfo-(-USER,-PASS-)"><a class="permalink" href="#authinfo-(-USER,-PASS-)">#</a><a id="authinfo"></a><a id="authinfo-USER-PASS"></a>authinfo ( USER, PASS )</dt> <dd> </dd> <dt id="list-()"><a class="permalink" href="#list-()">#</a><a id="list"></a>list ()</dt> <dd> <p>Obtain information about all the active newsgroups. The results is a reference to a hash where the key is a group name and each value is a reference to an array. The elements in this array are:- the last article number in the group, the first article number in the group and any information flags about the group.</p> </dd> <dt id="newgroups-(-SINCE-[,-DISTRIBUTIONS-])"><a class="permalink" href="#newgroups-(-SINCE-%5B,-DISTRIBUTIONS-%5D)">#</a><a id="newgroups"></a><a id="newgroups-SINCE-DISTRIBUTIONS"></a>newgroups ( SINCE [, DISTRIBUTIONS ])</dt> <dd> <p><code>SINCE</code> is a time value and <code>DISTRIBUTIONS</code> is either a distribution pattern or a reference to a list of distribution patterns. The result is the same as <code>list</code>, but the groups return will be limited to those created after <code>SINCE</code> and, if specified, in one of the distribution areas in <code>DISTRIBUTIONS</code>.</p> </dd> <dt id="newnews-(-SINCE-[,-GROUPS-[,-DISTRIBUTIONS-]])"><a class="permalink" href="#newnews-(-SINCE-%5B,-GROUPS-%5B,-DISTRIBUTIONS-%5D%5D)">#</a><a id="newnews"></a><a id="newnews-SINCE-GROUPS-DISTRIBUTIONS"></a>newnews ( SINCE [, GROUPS [, DISTRIBUTIONS ]])</dt> <dd> <p><code>SINCE</code> is a time value. <code>GROUPS</code> is either a group pattern or a reference to a list of group patterns. <code>DISTRIBUTIONS</code> is either a distribution pattern or a reference to a list of distribution patterns.</p> <p>Returns a reference to a list which contains the message-ids of all news posted after <code>SINCE</code>, that are in a groups which matched <code>GROUPS</code> and a distribution which matches <code>DISTRIBUTIONS</code>.</p> </dd> <dt id="next-()"><a class="permalink" href="#next-()">#</a><a id="next"></a>next ()</dt> <dd> <p>Set the &quot;current article pointer&quot; to the next article in the current newsgroup.</p> <p>Returns the message-id of the article.</p> </dd> <dt id="post-(-[-MESSAGE-]-)"><a class="permalink" href="#post-(-%5B-MESSAGE-%5D-)">#</a><a id="post"></a><a id="post-MESSAGE"></a>post ( [ MESSAGE ] )</dt> <dd> <p>Post a new article to the news server. If <code>MESSAGE</code> is specified and posting is allowed then the message will be sent.</p> <p>If <code>MESSAGE</code> is not specified then the message must be sent using the <code>datasend</code> and <code>dataend</code> methods from <a href="/5.8.1/Net::Cmd">Net::Cmd</a></p> <p><code>MESSAGE</code> can be either an array of lines or a reference to an array.</p> <p>The message, either sent via <code>datasend</code> or as the <code>MESSAGE</code> parameter, must be in the format as described by RFC822 and must contain From:, Newsgroups: and Subject: headers.</p> </dd> <dt id="postfh-()"><a class="permalink" href="#postfh-()">#</a><a id="postfh"></a>postfh ()</dt> <dd> <p>Post a new article to the news server using a tied filehandle. If posting is allowed, this method will return a tied filehandle that you can print() the contents of the article to be posted. You must explicitly close() the filehandle when you are finished posting the article, and the return value from the close() call will indicate whether the message was successfully posted.</p> </dd> <dt id="slave-()"><a class="permalink" href="#slave-()">#</a><a id="slave"></a>slave ()</dt> <dd> <p>Tell the remote server that I am not a user client, but probably another news server.</p> </dd> <dt id="quit-()"><a class="permalink" href="#quit-()">#</a><a id="quit"></a>quit ()</dt> <dd> <p>Quit the remote server and close the socket connection.</p> </dd> </dl> <h2 id="Extension-methods"><a class="permalink" href="#Extension-methods">#</a><a id="Extension"></a>Extension methods</h2> <p>These methods use commands that are not part of the RFC977 documentation. Some servers may not support all of them.</p> <dl> <dt id="newsgroups-(-[-PATTERN-]-)"><a class="permalink" href="#newsgroups-(-%5B-PATTERN-%5D-)">#</a><a id="newsgroups"></a><a id="newsgroups-PATTERN"></a>newsgroups ( [ PATTERN ] )</dt> <dd> <p>Returns a reference to a hash where the keys are all the group names which match <code>PATTERN</code>, or all of the groups if no pattern is specified, and each value contains the description text for the group.</p> </dd> <dt id="distributions-()"><a class="permalink" href="#distributions-()">#</a><a id="distributions"></a>distributions ()</dt> <dd> <p>Returns a reference to a hash where the keys are all the possible distribution names and the values are the distribution descriptions.</p> </dd> <dt id="subscriptions-()"><a class="permalink" href="#subscriptions-()">#</a><a id="subscriptions"></a>subscriptions ()</dt> <dd> <p>Returns a reference to a list which contains a list of groups which are recommended for a new user to subscribe to.</p> </dd> <dt id="overview_fmt-()"><a class="permalink" href="#overview_fmt-()">#</a><a id="overview_fmt"></a>overview_fmt ()</dt> <dd> <p>Returns a reference to an array which contain the names of the fields returned by <code>xover</code>.</p> </dd> <dt id="active_times-()"><a class="permalink" href="#active_times-()">#</a><a id="active_times"></a>active_times ()</dt> <dd> <p>Returns a reference to a hash where the keys are the group names and each value is a reference to an array containing the time the groups was created and an identifier, possibly an Email address, of the creator.</p> </dd> <dt id="active-(-[-PATTERN-]-)"><a class="permalink" href="#active-(-%5B-PATTERN-%5D-)">#</a><a id="active"></a><a id="active-PATTERN"></a>active ( [ PATTERN ] )</dt> <dd> <p>Similar to <code>list</code> but only active groups that match the pattern are returned. <code>PATTERN</code> can be a group pattern.</p> </dd> <dt id="xgtitle-(-PATTERN-)"><a class="permalink" href="#xgtitle-(-PATTERN-)">#</a><a id="xgtitle"></a><a id="xgtitle-PATTERN"></a>xgtitle ( PATTERN )</dt> <dd> <p>Returns a reference to a hash where the keys are all the group names which match <code>PATTERN</code> and each value is the description text for the group.</p> </dd> <dt id="xhdr-(-HEADER,-MESSAGE-SPEC-)"><a class="permalink" href="#xhdr-(-HEADER,-MESSAGE-SPEC-)">#</a><a id="xhdr"></a><a id="xhdr-HEADER-MESSAGE-SPEC"></a>xhdr ( HEADER, MESSAGE-SPEC )</dt> <dd> <p>Obtain the header field <code>HEADER</code> for all the messages specified.</p> <p>The return value will be a reference to a hash where the keys are the message numbers and each value contains the text of the requested header for that message.</p> </dd> <dt id="xover-(-MESSAGE-SPEC-)"><a class="permalink" href="#xover-(-MESSAGE-SPEC-)">#</a><a id="xover"></a><a id="xover-MESSAGE-SPEC"></a>xover ( MESSAGE-SPEC )</dt> <dd> <p>The return value will be a reference to a hash where the keys are the message numbers and each value contains a reference to an array which contains the overview fields for that message.</p> <p>The names of the fields can be obtained by calling <code>overview_fmt</code>.</p> </dd> <dt id="xpath-(-MESSAGE-ID-)"><a class="permalink" href="#xpath-(-MESSAGE-ID-)">#</a><a id="xpath"></a><a id="xpath-MESSAGE-ID"></a>xpath ( MESSAGE-ID )</dt> <dd> <p>Returns the path name to the file on the server which contains the specified message.</p> </dd> <dt id="xpat-(-HEADER,-PATTERN,-MESSAGE-SPEC)"><a class="permalink" href="#xpat-(-HEADER,-PATTERN,-MESSAGE-SPEC)">#</a><a id="xpat"></a><a id="xpat-HEADER-PATTERN-MESSAGE-SPEC"></a>xpat ( HEADER, PATTERN, MESSAGE-SPEC)</dt> <dd> <p>The result is the same as <code>xhdr</code> except the is will be restricted to headers where the text of the header matches <code>PATTERN</code></p> </dd> <dt id="xrover"><a class="permalink" href="#xrover">#</a>xrover</dt> <dd> <p>The XROVER command returns reference information for the article(s) specified.</p> <p>Returns a reference to a HASH where the keys are the message numbers and the values are the References: lines from the articles</p> </dd> <dt id="listgroup-(-[-GROUP-]-)"><a class="permalink" href="#listgroup-(-%5B-GROUP-%5D-)">#</a><a id="listgroup"></a><a id="listgroup-GROUP"></a>listgroup ( [ GROUP ] )</dt> <dd> <p>Returns a reference to a list of all the active messages in <code>GROUP</code>, or the current group if <code>GROUP</code> is not specified.</p> </dd> <dt id="reader"><a class="permalink" href="#reader">#</a>reader</dt> <dd> <p>Tell the server that you are a reader and not another server.</p> <p>This is required by some servers. For example if you are connecting to an INN server and you have transfer permission your connection will be connected to the transfer daemon, not the NNTP daemon. Issuing this command will cause the transfer daemon to hand over control to the NNTP daemon.</p> <p>Some servers do not understand this command, but issuing it and ignoring the response is harmless.</p> </dd> </dl> <h1 id="UNSUPPORTED"><a class="permalink" href="#UNSUPPORTED">#</a>UNSUPPORTED</h1> <p>The following NNTP command are unsupported by the package, and there are no plans to do so.</p> <pre><code class="plaintext">AUTHINFO GENERIC XTHREAD XSEARCH XINDEX</code></pre> <h1 id="DEFINITIONS"><a class="permalink" href="#DEFINITIONS">#</a>DEFINITIONS</h1> <dl> <dt id="MESSAGE-SPEC"><a class="permalink" href="#MESSAGE-SPEC">#</a><a id="MESSAGE"></a>MESSAGE-SPEC</dt> <dd> <p><code>MESSAGE-SPEC</code> is either a single message-id, a single message number, or a reference to a list of two message numbers.</p> <p>If <code>MESSAGE-SPEC</code> is a reference to a list of two message numbers and the second number in a range is less than or equal to the first then the range represents all messages in the group after the first message number.</p> <p><b>NOTE</b> For compatibility reasons only with earlier versions of Net::NNTP a message spec can be passed as a list of two numbers, this is deprecated and a reference to the list should now be passed</p> </dd> <dt id="PATTERN"><a class="permalink" href="#PATTERN">#</a>PATTERN</dt> <dd> <p>The <code>NNTP</code> protocol uses the <code>WILDMAT</code> format for patterns. The WILDMAT format was first developed by Rich Salz based on the format used in the UNIX &quot;find&quot; command to articulate file names. It was developed to provide a uniform mechanism for matching patterns in the same manner that the UNIX shell matches filenames.</p> <p>Patterns are implicitly anchored at the beginning and end of each string when testing for a match.</p> <p>There are five pattern matching operations other than a strict one-to-one match between the pattern and the source to be checked for a match.</p> <p>The first is an asterisk <code>*</code> to match any sequence of zero or more characters.</p> <p>The second is a question mark <code>?</code> to match any single character. The third specifies a specific set of characters.</p> <p>The set is specified as a list of characters, or as a range of characters where the beginning and end of the range are separated by a minus (or dash) character, or as any combination of lists and ranges. The dash can also be included in the set as a character it if is the beginning or end of the set. This set is enclosed in square brackets. The close square bracket <code>]</code> may be used in a set if it is the first character in the set.</p> <p>The fourth operation is the same as the logical not of the third operation and is specified the same way as the third with the addition of a caret character <code>^</code> at the beginning of the test string just inside the open square bracket.</p> <p>The final operation uses the backslash character to invalidate the special meaning of an open square bracket <code>[</code>, the asterisk, backslash or the question mark. Two backslashes in sequence will result in the evaluation of the backslash as a character with no special meaning.</p> <dl> <dt id="Examples"><a class="permalink" href="#Examples">#</a>Examples</dt> <dd> </dd> <dt id="[^]-]"><a class="permalink" href="#%5B%5E%5D-%5D">#</a><a id="pod"></a><code>[^]-]</code></dt> <dd> <p>matches any single character other than a close square bracket or a minus sign/dash.</p> </dd> <dt id="*bdc"><a class="permalink" href="#*bdc">#</a><a id="bdc"></a><code>*bdc</code></dt> <dd> <p>matches any string that ends with the string &quot;bdc&quot; including the string &quot;bdc&quot; (without quotes).</p> </dd> <dt id="[0-9a-zA-Z]"><a class="permalink" href="#%5B0-9a-zA-Z%5D">#</a><a id="a-zA-Z"></a><code>[0-9a-zA-Z]</code></dt> <dd> <p>matches any single printable alphanumeric ASCII character.</p> </dd> <dt id="a??d"><a class="permalink" href="#a??d">#</a><a id="a"></a><a id="a-d"></a><code>a??d</code></dt> <dd> <p>matches any four character string which begins with a and ends with d.</p> </dd> </dl> </dd> </dl> <h1 id="SEE-ALSO"><a class="permalink" href="#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1> <p><a href="/5.8.1/Net::Cmd">Net::Cmd</a></p> <h1 id="AUTHOR"><a class="permalink" href="#AUTHOR">#</a>AUTHOR</h1> <p>Graham Barr &lt;gbarr@pobox.com&gt;</p> <h1 id="COPYRIGHT"><a class="permalink" href="#COPYRIGHT">#</a>COPYRIGHT</h1> <p>Copyright (c) 1995-1997 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p> <hr> <p><i>$Id: //depot/libnet/Net/NNTP.pm#18 $</i></p> </div> <div id="footer"> <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p> <p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> <script src="/js/highlight.pack.js"></script> <script>hljs.highlightAll();</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10