Net::NNTP::Functions - code to implement NNTP-standard functions
use Net::NNTP::Functions; my ($first1, $last1) = messagespec( "4-12" ); # Returns (4, 12) my ($first2, $last2) = messagespec( 4 ); # Returns (4, undef) my ($first3, $last3) = messagespec( [4, 12] ); # Returns (4, 12) my ($first4, $last4) = messagespec( "4-3" ); # Returns (4, -1) my $match = wildmat( 'rec.*', $string );
The NNTP specification, as described by Net::NNTP, defines two speficiations: MESSAGE-SPEC, for defining a range of messages, and PATTERN, for pattern-matching over NNTP. These functions attempt to implement this behaviour.
MESSAGE-SPEC
PATTERN
Returns an array (or array reference) of two items (FIRST and LAST for reference), based on the passed item. If we get an ARRAYREF, it's assumed to be list of two items FIRST and LAST; if it's a MESSAGEID or MESSAGENUMBER then FIRST is the value, and LAST is 'undef';
ARRAYREF
MESSAGEID
MESSAGENUMBER
If the LAST item is less than FIRST, then we set LAST to '-1'. This allows later functions to (correctly) interpret this for a list of all items after FIRST.
Implements the WILDMAT format, as described in the Net::NNTP page (which I won't repeat here).
Doesn't currently implement the entire functionality; all that currently works is the anchoring, '*', and '?'. Ranges of characters ('[]') and invertings ('^') don't work. (Correction: they might work, I haven't tried).
Taken from http://cvs.trainedmonkey.com/viewcvs.cgi/colobus/colobus?rev=1.41 .
Net::NNTP, specifically its manual page sections on WILDMAT and MESSAGESPEC.
Write the rest of the functionality for wildmat().
Tim Skirvin <tskirvin@killfile.org>. wildmat() in its current form was written by Jim Winstead Jr.
Copyright 2003 by Tim Skirvin <tskirvin@killfile.org>. This code may be distributed under the same terms as Perl itself.
To install News::NNTPAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm News::NNTPAuth
CPAN shell
perl -MCPAN -e shell install News::NNTPAuth
For more information on module installation, please visit the detailed CPAN module installation guide.