summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man3/Net::NNTP.3perl
blob: 01f4bad5400a45365f276e4d00ca6ae8f5b596c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Net::NNTP 3perl"
.TH Net::NNTP 3perl 2024-05-30 "perl v5.38.2" "Perl Programmers Reference Guide"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
Net::NNTP \- NNTP Client class
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\&    use Net::NNTP;
\&
\&    $nntp = Net::NNTP\->new("some.host.name");
\&    $nntp\->quit;
\&
\&    # start with SSL, e.g. nntps
\&    $nntp = Net::NNTP\->new("some.host.name", SSL => 1);
\&
\&    # start with plain and upgrade to SSL
\&    $nntp = Net::NNTP\->new("some.host.name");
\&    $nntp\->starttls;
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
\&\f(CW\*(C`Net::NNTP\*(C'\fR is a class implementing a simple NNTP client in Perl as described
in RFC977 and RFC4642.
With IO::Socket::SSL installed it also provides support for implicit and
explicit TLS encryption, i.e. NNTPS or NNTP+STARTTLS.
.PP
The Net::NNTP class is a subclass of Net::Cmd and (depending on avaibility) of
IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.
.SS "Class Methods"
.IX Subsection "Class Methods"
.ie n .IP """new([$host][, %options])""" 4
.el .IP "\f(CWnew([$host][, %options])\fR" 4
.IX Item "new([$host][, %options])"
This is the constructor for a new Net::NNTP object. \f(CW$host\fR is the
name of the remote host to which a NNTP connection is required. If not
given then it may be passed as the \f(CW\*(C`Host\*(C'\fR option described below. If no host is passed
then two environment variables are checked, first \f(CW\*(C`NNTPSERVER\*(C'\fR then
\&\f(CW\*(C`NEWSHOST\*(C'\fR, then \f(CW\*(C`Net::Config\*(C'\fR is checked, and if a host is not found
then \f(CW\*(C`news\*(C'\fR is used.
.Sp
\&\f(CW%options\fR are passed in a hash like fashion, using key and value pairs.
Possible options are:
.Sp
\&\fBHost\fR \- NNTP host to connect to. It may be a single scalar, as defined for
the \f(CW\*(C`PeerAddr\*(C'\fR option in IO::Socket::INET, or a reference to
an array with hosts to try in turn. The "host" method will return the value
which was used to connect to the host.
.Sp
\&\fBPort\fR \- port to connect to.
Default \- 119 for plain NNTP and 563 for immediate SSL (nntps).
.Sp
\&\fBSSL\fR \- If the connection should be done from start with SSL, contrary to later
upgrade with \f(CW\*(C`starttls\*(C'\fR.
You can use SSL arguments as documented in IO::Socket::SSL, but it will
usually use the right arguments already.
.Sp
\&\fBTimeout\fR \- 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)
.Sp
\&\fBDebug\fR \- Enable the printing of debugging information to STDERR
.Sp
\&\fBReader\fR \- If the remote server is INN then initially the connection
will be to innd, by default \f(CW\*(C`Net::NNTP\*(C'\fR will issue a \f(CW\*(C`MODE READER\*(C'\fR command
so that the remote server becomes nnrpd. If the \f(CW\*(C`Reader\*(C'\fR option is given
with a value of zero, then this command will not be sent and the
connection will be left talking to innd.
.Sp
\&\fBLocalAddr\fR and \fBLocalPort\fR \- These parameters are passed directly
to IO::Socket to allow binding the socket to a specific local address and port.
.Sp
\&\fBDomain\fR \- This parameter is passed directly to IO::Socket and makes it
possible to enforce IPv4 connections even if IO::Socket::IP is used as super
class. Alternatively \fBFamily\fR can be used.
.SS "Object Methods"
.IX Subsection "Object Methods"
Unless otherwise stated all methods return either a \fItrue\fR or \fIfalse\fR
value, with \fItrue\fR meaning that the operation was a success. When a method
states that it returns a value, failure will be returned as \fIundef\fR or an
empty list.
.PP
\&\f(CW\*(C`Net::NNTP\*(C'\fR inherits from \f(CW\*(C`Net::Cmd\*(C'\fR so methods defined in \f(CW\*(C`Net::Cmd\*(C'\fR may
be used to send commands to the remote NNTP server in addition to the methods
documented here.
.ie n .IP host() 4
.el .IP \f(CWhost()\fR 4
.IX Item "host()"
Returns the value used by the constructor, and passed to IO::Socket::INET,
to connect to the host.
.ie n .IP starttls() 4
.el .IP \f(CWstarttls()\fR 4
.IX Item "starttls()"
Upgrade existing plain connection to SSL.
Any arguments necessary for SSL must be given in \f(CW\*(C`new\*(C'\fR already.
.ie n .IP """article([{$msgid|$msgnum}[, $fh]])""" 4
.el .IP "\f(CWarticle([{$msgid|$msgnum}[, $fh]])\fR" 4
.IX Item "article([{$msgid|$msgnum}[, $fh]])"
Retrieve the header, a blank line, then the body (text) of the
specified article.
.Sp
If \f(CW$fh\fR 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 \f(CW$fh\fR is not specified then the return value, on success,
will be a reference to an array containing the article requested, each
entry in the array will contain one line of the article.
.Sp
If no arguments are passed then the current article in the currently
selected newsgroup is fetched.
.Sp
\&\f(CW$msgnum\fR is a numeric id of an article in the current newsgroup, and
will change the current article pointer.  \f(CW$msgid\fR is the message id of
an article as shown in that article's header.  It is anticipated that the
client will obtain the \f(CW$msgid\fR from a list provided by the \f(CW\*(C`newnews\*(C'\fR
command, from references contained within another article, or from the
message-id provided in the response to some other commands.
.Sp
If there is an error then \f(CW\*(C`undef\*(C'\fR will be returned.
.ie n .IP """body([{$msgid|$msgnum}[, [$fh]])""" 4
.el .IP "\f(CWbody([{$msgid|$msgnum}[, [$fh]])\fR" 4
.IX Item "body([{$msgid|$msgnum}[, [$fh]])"
Like \f(CW\*(C`article\*(C'\fR but only fetches the body of the article.
.ie n .IP """head([{$msgid|$msgnum}[, [$fh]])""" 4
.el .IP "\f(CWhead([{$msgid|$msgnum}[, [$fh]])\fR" 4
.IX Item "head([{$msgid|$msgnum}[, [$fh]])"
Like \f(CW\*(C`article\*(C'\fR but only fetches the headers for the article.
.ie n .IP articlefh([{$msgid|$msgnum}]) 4
.el .IP \f(CWarticlefh([{$msgid|$msgnum}])\fR 4
.IX Item "articlefh([{$msgid|$msgnum}])"
.PD 0
.ie n .IP bodyfh([{$msgid|$msgnum}]) 4
.el .IP \f(CWbodyfh([{$msgid|$msgnum}])\fR 4
.IX Item "bodyfh([{$msgid|$msgnum}])"
.ie n .IP headfh([{$msgid|$msgnum}]) 4
.el .IP \f(CWheadfh([{$msgid|$msgnum}])\fR 4
.IX Item "headfh([{$msgid|$msgnum}])"
.PD
These are similar to \fBarticle()\fR, \fBbody()\fR and \fBhead()\fR, but rather than
returning the requested data directly, they return a tied filehandle
from which to read the article.
.ie n .IP nntpstat([{$msgid|$msgnum}]) 4
.el .IP \f(CWnntpstat([{$msgid|$msgnum}])\fR 4
.IX Item "nntpstat([{$msgid|$msgnum}])"
The \f(CW\*(C`nntpstat\*(C'\fR command is similar to the \f(CW\*(C`article\*(C'\fR command except that no
text is returned.  When selecting by message number within a group,
the \f(CW\*(C`nntpstat\*(C'\fR command serves to set the "current article pointer" without
sending text.
.Sp
Using the \f(CW\*(C`nntpstat\*(C'\fR command to
select by message-id is valid but of questionable value, since a
selection by message-id does \fBnot\fR alter the "current article pointer".
.Sp
Returns the message-id of the "current article".
.ie n .IP group([$group]) 4
.el .IP \f(CWgroup([$group])\fR 4
.IX Item "group([$group])"
Set and/or get the current group. If \f(CW$group\fR is not given then information
is returned on the current group.
.Sp
In a scalar context it returns the group name.
.Sp
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.
.ie n .IP help() 4
.el .IP \f(CWhelp()\fR 4
.IX Item "help()"
Request help text (a short summary of commands that are understood by this
implementation) from the server. Returns the text or undef upon failure.
.ie n .IP """ihave($msgid[, $message])""" 4
.el .IP "\f(CWihave($msgid[, $message])\fR" 4
.IX Item "ihave($msgid[, $message])"
The \f(CW\*(C`ihave\*(C'\fR command informs the server that the client has an article
whose id is \f(CW$msgid\fR.  If the server desires a copy of that
article and \f(CW$message\fR has been given then it will be sent.
.Sp
Returns \fItrue\fR if the server desires the article and \f(CW$message\fR was
successfully sent, if specified.
.Sp
If \f(CW$message\fR is not specified then the message must be sent using the
\&\f(CW\*(C`datasend\*(C'\fR and \f(CW\*(C`dataend\*(C'\fR methods from Net::Cmd
.Sp
\&\f(CW$message\fR can be either an array of lines or a reference to an array
and must be encoded by the caller to octets of whatever encoding is required,
e.g. by using the Encode module's \f(CWencode()\fR function.
.ie n .IP last() 4
.el .IP \f(CWlast()\fR 4
.IX Item "last()"
Set the "current article pointer" to the previous article in the current
newsgroup.
.Sp
Returns the message-id of the article.
.ie n .IP date() 4
.el .IP \f(CWdate()\fR 4
.IX Item "date()"
Returns the date on the remote server. This date will be in a UNIX time
format (seconds since 1970)
.ie n .IP postok() 4
.el .IP \f(CWpostok()\fR 4
.IX Item "postok()"
\&\f(CW\*(C`postok\*(C'\fR will return \fItrue\fR if the servers initial response indicated
that it will allow posting.
.ie n .IP """authinfo($user, $pass)""" 4
.el .IP "\f(CWauthinfo($user, $pass)\fR" 4
.IX Item "authinfo($user, $pass)"
Authenticates to the server (using the original AUTHINFO USER / AUTHINFO PASS
form, defined in RFC2980) using the supplied username and password.  Please
note that the password is sent in clear text to the server.  This command
should not be used with valuable passwords unless the connection to the server
is somehow protected.
.ie n .IP """authinfo_simple($user, $pass)""" 4
.el .IP "\f(CWauthinfo_simple($user, $pass)\fR" 4
.IX Item "authinfo_simple($user, $pass)"
Authenticates to the server (using the proposed NNTP V2 AUTHINFO SIMPLE form,
defined and deprecated in RFC2980) using the supplied username and password.
As with "authinfo" the password is sent in clear text.
.ie n .IP list() 4
.el .IP \f(CWlist()\fR 4
.IX Item "list()"
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.
.ie n .IP """newgroups($since[, $distributions])""" 4
.el .IP "\f(CWnewgroups($since[, $distributions])\fR" 4
.IX Item "newgroups($since[, $distributions])"
\&\f(CW$since\fR is a time value and \f(CW$distributions\fR is either a distribution
pattern or a reference to a list of distribution patterns.
The result is the same as \f(CW\*(C`list\*(C'\fR, but the
groups return will be limited to those created after \f(CW$since\fR and, if
specified, in one of the distribution areas in \f(CW$distributions\fR.
.ie n .IP """newnews($since[, $groups[, $distributions]])""" 4
.el .IP "\f(CWnewnews($since[, $groups[, $distributions]])\fR" 4
.IX Item "newnews($since[, $groups[, $distributions]])"
\&\f(CW$since\fR is a time value. \f(CW$groups\fR is either a group pattern or a reference
to a list of group patterns. \f(CW$distributions\fR is either a distribution
pattern or a reference to a list of distribution patterns.
.Sp
Returns a reference to a list which contains the message-ids of all news posted
after \f(CW$since\fR, that are in a groups which matched \f(CW$groups\fR and a
distribution which matches \f(CW$distributions\fR.
.ie n .IP next() 4
.el .IP \f(CWnext()\fR 4
.IX Item "next()"
Set the "current article pointer" to the next article in the current
newsgroup.
.Sp
Returns the message-id of the article.
.ie n .IP post([$message]) 4
.el .IP \f(CWpost([$message])\fR 4
.IX Item "post([$message])"
Post a new article to the news server. If \f(CW$message\fR is specified and posting
is allowed then the message will be sent.
.Sp
If \f(CW$message\fR is not specified then the message must be sent using the
\&\f(CW\*(C`datasend\*(C'\fR and \f(CW\*(C`dataend\*(C'\fR methods from Net::Cmd
.Sp
\&\f(CW$message\fR can be either an array of lines or a reference to an array
and must be encoded by the caller to octets of whatever encoding is required,
e.g. by using the Encode module's \f(CWencode()\fR function.
.Sp
The message, either sent via \f(CW\*(C`datasend\*(C'\fR or as the \f(CW$message\fR
parameter, must be in the format as described by RFC822 and must
contain From:, Newsgroups: and Subject: headers.
.ie n .IP postfh() 4
.el .IP \f(CWpostfh()\fR 4
.IX Item "postfh()"
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 \fBprint()\fR the contents of the article to be posted.  You must
explicitly \fBclose()\fR the filehandle when you are finished posting the
article, and the return value from the \fBclose()\fR call will indicate
whether the message was successfully posted.
.ie n .IP slave() 4
.el .IP \f(CWslave()\fR 4
.IX Item "slave()"
Tell the remote server that I am not a user client, but probably another
news server.
.ie n .IP quit() 4
.el .IP \f(CWquit()\fR 4
.IX Item "quit()"
Quit the remote server and close the socket connection.
.ie n .IP can_inet6() 4
.el .IP \f(CWcan_inet6()\fR 4
.IX Item "can_inet6()"
Returns whether we can use IPv6.
.ie n .IP can_ssl() 4
.el .IP \f(CWcan_ssl()\fR 4
.IX Item "can_ssl()"
Returns whether we can use SSL.
.SS "Extension Methods"
.IX Subsection "Extension Methods"
These methods use commands that are not part of the RFC977 documentation. Some
servers may not support all of them.
.ie n .IP newsgroups([$pattern]) 4
.el .IP \f(CWnewsgroups([$pattern])\fR 4
.IX Item "newsgroups([$pattern])"
Returns a reference to a hash where the keys are all the group names which
match \f(CW$pattern\fR, or all of the groups if no pattern is specified, and
each value contains the description text for the group.
.ie n .IP distributions() 4
.el .IP \f(CWdistributions()\fR 4
.IX Item "distributions()"
Returns a reference to a hash where the keys are all the possible
distribution names and the values are the distribution descriptions.
.ie n .IP distribution_patterns() 4
.el .IP \f(CWdistribution_patterns()\fR 4
.IX Item "distribution_patterns()"
Returns a reference to an array where each element, itself an array
reference, consists of the three fields of a line of the distrib.pats list
maintained by some NNTP servers, namely: a weight, a wildmat and a value
which the client may use to construct a Distribution header.
.ie n .IP subscriptions() 4
.el .IP \f(CWsubscriptions()\fR 4
.IX Item "subscriptions()"
Returns a reference to a list which contains a list of groups which
are recommended for a new user to subscribe to.
.ie n .IP overview_fmt() 4
.el .IP \f(CWoverview_fmt()\fR 4
.IX Item "overview_fmt()"
Returns a reference to an array which contain the names of the fields returned
by \f(CW\*(C`xover\*(C'\fR.
.ie n .IP active_times() 4
.el .IP \f(CWactive_times()\fR 4
.IX Item "active_times()"
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.
.ie n .IP active([$pattern]) 4
.el .IP \f(CWactive([$pattern])\fR 4
.IX Item "active([$pattern])"
Similar to \f(CW\*(C`list\*(C'\fR but only active groups that match the pattern are returned.
\&\f(CW$pattern\fR can be a group pattern.
.ie n .IP xgtitle($pattern) 4
.el .IP \f(CWxgtitle($pattern)\fR 4
.IX Item "xgtitle($pattern)"
Returns a reference to a hash where the keys are all the group names which
match \f(CW$pattern\fR and each value is the description text for the group.
.ie n .IP """xhdr($header, $message_spec)""" 4
.el .IP "\f(CWxhdr($header, $message_spec)\fR" 4
.IX Item "xhdr($header, $message_spec)"
Obtain the header field \f(CW$header\fR for all the messages specified.
.Sp
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.
.ie n .IP xover($message_spec) 4
.el .IP \f(CWxover($message_spec)\fR 4
.IX Item "xover($message_spec)"
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.
.Sp
The names of the fields can be obtained by calling \f(CW\*(C`overview_fmt\*(C'\fR.
.ie n .IP xpath($message_id) 4
.el .IP \f(CWxpath($message_id)\fR 4
.IX Item "xpath($message_id)"
Returns the path name to the file on the server which contains the specified
message.
.ie n .IP """xpat($header, $pattern, $message_spec)""" 4
.el .IP "\f(CWxpat($header, $pattern, $message_spec)\fR" 4
.IX Item "xpat($header, $pattern, $message_spec)"
The result is the same as \f(CW\*(C`xhdr\*(C'\fR except the is will be restricted to
headers where the text of the header matches \f(CW$pattern\fR
.ie n .IP xrover($message_spec) 4
.el .IP \f(CWxrover($message_spec)\fR 4
.IX Item "xrover($message_spec)"
The XROVER command returns reference information for the article(s)
specified.
.Sp
Returns a reference to a HASH where the keys are the message numbers and the
values are the References: lines from the articles
.ie n .IP listgroup([$group]) 4
.el .IP \f(CWlistgroup([$group])\fR 4
.IX Item "listgroup([$group])"
Returns a reference to a list of all the active messages in \f(CW$group\fR, or
the current group if \f(CW$group\fR is not specified.
.ie n .IP reader() 4
.el .IP \f(CWreader()\fR 4
.IX Item "reader()"
Tell the server that you are a reader and not another server.
.Sp
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.
.Sp
Some servers do not understand this command, but issuing it and ignoring
the response is harmless.
.SS Unsupported
.IX Subsection "Unsupported"
The following NNTP command are unsupported by the package, and there are
no plans to do so.
.PP
.Vb 4
\&    AUTHINFO GENERIC
\&    XTHREAD
\&    XSEARCH
\&    XINDEX
.Ve
.SS Definitions
.IX Subsection "Definitions"
.ie n .IP $message_spec 4
.el .IP \f(CW$message_spec\fR 4
.IX Item "$message_spec"
\&\f(CW$message_spec\fR is either a single message-id, a single message number, or
a reference to a list of two message numbers.
.Sp
If \f(CW$message_spec\fR 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.
.Sp
\&\fBNOTE\fR 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
.ie n .IP $pattern 4
.el .IP \f(CW$pattern\fR 4
.IX Item "$pattern"
The \f(CW\*(C`NNTP\*(C'\fR protocol uses the \f(CW\*(C`WILDMAT\*(C'\fR 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.
.Sp
Patterns are implicitly anchored at the
beginning and end of each string when testing for a match.
.Sp
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.
.Sp
The first is an asterisk \f(CW\*(C`*\*(C'\fR to match any sequence of zero or more
characters.
.Sp
The second is a question mark \f(CW\*(C`?\*(C'\fR to match any single character. The
third specifies a specific set of characters.
.Sp
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 \f(CW\*(C`]\*(C'\fR may be used in a set if it is the first
character in the set.
.Sp
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 \f(CW\*(C`^\*(C'\fR at
the beginning of the test string just inside the open square
bracket.
.Sp
The final operation uses the backslash character to
invalidate the special meaning of an open square bracket \f(CW\*(C`[\*(C'\fR,
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.
.RS 4
.IP Examples 4
.IX Item "Examples"
.PD 0
.ie n .IP """[^]\-]""" 4
.el .IP \f(CW[^]\-]\fR 4
.IX Item "[^]-]"
.PD
matches any single character other than a close square
bracket or a minus sign/dash.
.ie n .IP *bdc 4
.el .IP \f(CW*bdc\fR 4
.IX Item "*bdc"
matches any string that ends with the string "bdc"
including the string "bdc" (without quotes).
.ie n .IP """[0\-9a\-zA\-Z]""" 4
.el .IP \f(CW[0\-9a\-zA\-Z]\fR 4
.IX Item "[0-9a-zA-Z]"
matches any single printable alphanumeric ASCII character.
.ie n .IP """a??d""" 4
.el .IP \f(CWa??d\fR 4
.IX Item "a??d"
matches any four character string which begins
with a and ends with d.
.RE
.RS 4
.RE
.SH EXPORTS
.IX Header "EXPORTS"
\&\fINone\fR.
.SH "KNOWN BUGS"
.IX Header "KNOWN BUGS"
See <https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Net::Cmd,
IO::Socket::SSL.
.SH AUTHOR
.IX Header "AUTHOR"
Graham Barr <gbarr@pobox.com <mailto:gbarr@pobox.com>>.
.PP
Steve Hay <shay@cpan.org <mailto:shay@cpan.org>> is now maintaining
libnet as of version 1.22_02.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright (C) 1995\-1997 Graham Barr.  All rights reserved.
.PP
Copyright (C) 2013\-2016, 2020 Steve Hay.  All rights reserved.
.SH LICENCE
.IX Header "LICENCE"
This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the \fILICENCE\fR file.
.SH VERSION
.IX Header "VERSION"
Version 3.15
.SH DATE
.IX Header "DATE"
20 March 2023
.SH HISTORY
.IX Header "HISTORY"
See the \fIChanges\fR file.