![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
use Net::NNTP; $nntp = Net::NNTP->new("some.host.name"); $nntp->quit;
Net::NNTP
is a class implementing a simple NNTP client in Perl as described in
RFC977. Net::NNTP
inherits its communication methods from Net::Cmd
HOST
is the name of the remote host to which a NNTP connection is required. If
not given two environment variables are checked, first NNTPSERVER
then
NEWSHOST
, then Net::Config
is checked, and if a host is not found then news
is used.
OPTIONS
are passed in a hash like fashion, using key and value pairs. Possible
options are:
Timeout - 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)
Debug - Enable the printing of debugging information to STDERR
If no arguments are passed then the current article in the current newsgroup is returned.
MSGNUM
is a numeric id of an article in the current newsgroup, and will change the
current article pointer.
MSGID
is the message id of an article as shown in that article's header. It is
anticipated that the client will obtain the MSGID
from a list provided by the newnews
command, from references contained within another article, or from the
message-id provided in the response to some other commands.
Returns a reference to an array containing the article.
Takes the same arguments as article
Returns a reference to an array containing the body of the article.
Takes the same arguments as article
Returns a reference to an array containing the header of the article.
Using the nntpstat command to select by message-id is valid but of questionable value, since a selection by message-id does not alter the ``current article pointer''.
Returns the message-id of the ``current article''.
GROUP
is not given then information is returned on the current group.
In a scalar context it returns the group name.
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.
MSGID
. If the server desires a copy of that article, and MESSAGE has been given the it will be sent.
Returns true if the server desires the article and MESSAGE was successfully sent,if specified.
If MESSAGE is not specified then the message must be sent using the
datasend
and dataend
methods from Cmd
MESSAGE can be either an array of lines or a reference to an array.
Returns the message-id of the article.
SINCE
is a time value and DISTRIBUTIONS
is either a distribution pattern or a reference to a list of distribution
patterns. The result is the same as list, but the groups return will be limited to those created after SINCE
and, if specified, in one of the distribution areas in DISTRIBUTIONS
.
SINCE
is a time value. GROUPS
is either a group pattern or a reference to a list of group patterns. DISTRIBUTIONS
is either a distribution pattern or a reference to a list of distribution
patterns.
Returns a reference to a list which contains the message-ids of all news
posted after SINCE
, that are in a groups which matched GROUPS
and a distribution which matches DISTRIBUTIONS
.
Returns the message-id of the article.
If MESSAGE is not specified then the message must be sent using the
datasend
and dataend
methods from Cmd
MESSAGE can be either an array of lines or a reference to an array.
HEADER
for all the messages specified.
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.
The names of the fields can be obtained by calling overview_fmt.
article(s)
specified.
Returns a reference to a HASH where the keys are the message numbers and the values are the References: lines from the articles
AUTHINFO GENERIC XTHREAD XSEARCH XINDEX
MESSAGE-SPEC
is either a single message-id, a single message number, or a reference to a
list of two message numbers.
If MESSAGE-SPEC
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.
NOTE For compatibility reasons only with earlier versions of Net::NNTP a message spec can be passed as a list of two numbers, this is depreciated and a reference to the list should now be passed
NNTP
protocol uses the WILDMAT
format for patterns. The WILDMAT format was first developed by Rich Salz
based on the format used in the UNIX ``find'' 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.
Patterns are implicitly anchored at the beginning and end of each string when testing for a match.
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.
The first is an asterisk *
to match any sequence of zero or more characters.
The second is a question mark ?
to match any single character. The third specifies a specific set of
characters.
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 ]
may be used in a set if it is the first character in the set.
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 ^
at the beginning of the test string just inside the open square bracket.
The final operation uses the backslash character to invalidate the special
meaning of the a open square bracket [
, 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.
$CommentsMailTo = "perl5@dcs.ed.ac.uk"; include("../syssies_footer.inc");?>