Tim Skirvin > newslib > Net::NNTP::Functions

Download:
newslib-0.84.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.21   Source  

NAME ^

Net::NNTP::Functions - code to implement NNTP-standard functions

SYNOPSIS ^

  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 );

DESCRIPTION ^

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.

Functions

messagespec ( ARRAYREF | MESSAGEID | MESSAGENUMBER )

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';

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.

wildmat ( EXPRESSION, STRING )

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 .

SEE ALSO ^

Net::NNTP, specifically its manual page sections on WILDMAT and MESSAGESPEC.

TODO ^

Write the rest of the functionality for wildmat().

AUTHOR ^

Tim Skirvin <tskirvin@killfile.org>. wildmat() in its current form was written by Jim Winstead Jr.

COPYRIGHT ^

Copyright 2003 by Tim Skirvin <tskirvin@killfile.org>. This code may be distributed under the same terms as Perl itself.

syntax highlighting: