NAME

List::Filter::Filters::Standard - define standard List::Filter filter methods

SYNOPSIS

# This module is not intended to be used directly
# See: L<List::Filter::Dispatcher>

DESCRIPTION

This module defines the standard List::Filter filter methods. This is to say that it supplies a series of methods that can be used with a List::Filter "filter" to do the actual filtering operations upon a list of input strings.

Note that this module uses Exporter to export all of it's subs, but these subs must be written as methods (e.g. with "my $self = shift" as first the line), because that's how they'll ultimately be used. Here "$self" is a "Dispatcher" object, and has nothing to do with this package.

interface

Each of these subs begins with:

my $self            = shift;
my $filter          = shift;  # object (href based)
my $items           = shift;  # aref
my $opt             = shift;  # href of options (which is itself optional)

And each returns an aref. See "creating new filter methods" in List::Filter::Project.

METHODS

search filter filter methods

These are the methods that apply a list of search criteria. Each search filter specifies one of these methods to use by default.

They all have identical interfaces: they take two input arguments, a search filter and a reference to a list of strings to be filtered, and they return an array reference of strings that meet the search criteria.

find_any

Pass through an item if it matches any one of the search terms/patterns.

Input:

(1) a search filter structure (which contains an aref of search patterns),

(2) arrayref of items to be searched

Return: arrayref of items that match all criteria.

skip_any

Pass through an item only if it does not match any of the search terms/patterns.

Input: (1) a search filter structure (which contains an aref of search patterns), (2) arrayref of items to be searched Return: arrayref of items that match all criteria.

match_all_any_order

Pass through an item if it matches all of the search criteria (irrespective of the the order of the matches inside the string).

On each term of the search criteria, a leading minus sign may reverse the sense of the match.

Input:

(1) a search filter structure (which contains an aref of search patterns),

(2) arrayref of items to be searched

Return: arrayref of items that match all criteria.

1;

SEE ALSO

List::Filter

AUTHOR

Joseph Brenner, <doom@kzsu.stanford.edu>

COPYRIGHT AND LICENSE

Copyright (C) 2007 by Joseph Brenner

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

BUGS

None reported... yet.