| Text-Query documentation | Contained in the Text-Query distribution. |
Text::Query::Solve - Base class for query resolution
package Text::Query::SolveSource;
use Text::Query::Parse;
use vars qw(@ISA);
@ISA = qw(Text::Query::Solve);
This module provides a virtual base class for query resolution.
It defines the match and matchscalar method that is called by the Text::Query
object to apply a query on a data source.
If TARGET is a scalar, match returns a true value if the data source
specified by TARGET matches the EXPR query expression. If
TARGET is not given, the match is made against $_.
If TARGET is an array, match returns a (possibly empty) list of all
matching elements. If the elements of the array are references to sub-
arrays, the match is done against the first element of each sub-array.
This allows arbitrary information (e.g. filenames) to be associated with
each data source to match.
If TARGET is a reference to an array, match returns a reference to
a (possibly empty) list of all matching elements.
Behaves just like MATCH when TARGET is a scalar or is not given.
Text::Query(3)
Eric Bohlman (ebohlman@netcom.com)
Loic Dachary (loic@senga.org)
| Text-Query documentation | Contained in the Text-Query distribution. |
# # Copyright (C) 1999 Eric Bohlman, Loic Dachary # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. You may also use, redistribute and/or modify it # under the terms of the Artistic License supplied with your Perl # distribution # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # # # $Header: /usr/local/cvsroot/Text-Query/lib/Text/Query/Solve.pm,v 1.2 1999/06/14 12:53:58 loic Exp $ # package Text::Query::Solve; use strict; sub new { my $class=shift; my $self={}; bless $self,$class; $self->initialize(); return $self; } sub initialize { } sub match { my($self, $expr) = shift; croak("not implemented"); } sub matchscalar { my($self, $expr) = shift; croak("not implemented"); } 1; __END__
# Local Variables: *** # mode: perl *** # End: ***