--- nfo/perl/libs/Data/Query/Filter/Regexp.pm 2002/12/23 04:22:22 1.1 +++ nfo/perl/libs/Data/Query/Filter/Regexp.pm 2003/05/13 07:45:21 1.5 @@ -1,7 +1,19 @@ ## ------------------------------------------------------------------------ -## $Id: Regexp.pm,v 1.1 2002/12/23 04:22:22 joko Exp $ +## $Id: Regexp.pm,v 1.5 2003/05/13 07:45:21 joko Exp $ ## ------------------------------------------------------------------------ ## $Log: Regexp.pm,v $ +## Revision 1.5 2003/05/13 07:45:21 joko +## now returns report +## +## Revision 1.4 2003/03/27 15:31:03 joko +## fixes to modules regarding new namespace(s) below Data::Mungle::* +## +## Revision 1.3 2003/02/20 18:56:41 joko +## renamed modules +## +## Revision 1.2 2003/02/09 04:53:23 joko +## + object creation done via new mechanism +## ## Revision 1.1 2002/12/23 04:22:22 joko ## + refactored from Data::Filter ## @@ -16,14 +28,14 @@ use strict; use warnings; -use base 'DesignPattern::Object::Logger'; +use base qw( DesignPattern::Logger ); use Data::Dumper; use Regexp::Group; -use libp qw( mkObject ); -use Data::Compare::Struct qw( isEmpty ); +use DesignPattern::Object; +use Data::Mungle::Compare::Struct qw( isEmpty ); # ------------ common perl object constructor ------------ sub new { @@ -47,9 +59,8 @@ my $self = shift; # try to load filter-declaration from configuration scope inside perl-module (yes - it's already abstracted out there!) - $self->{declaration} = mkObject($self->{module}); -#print Dumper($self->{declaration}); - + $self->{declaration} = DesignPattern::Object->fromPackage($self->{module}); + #print Dumper($self->{declaration}); # the regexp-object which does the hard work for us ;-) $self->{regexp} = Regexp::Group->new( @@ -59,6 +70,7 @@ 'patterns' => $self->{declaration}->patterns(), 'coderefs' => $self->{declaration}->coderefs(), 'verbose' => 1, + 'LOG_VERBOSE' => 0, ); } @@ -70,7 +82,7 @@ #print "cb: $coderef", "\n"; - my $result = $self->{regexp}->scan($steps, $coderef); + $self->{regexp}->scan($steps, $coderef); # configure tracing # respects additional trace-options passed to _trace-method @@ -83,7 +95,7 @@ #$self->trace('matches after Regexp::Group->scan', $self->{regexp}->getMatches(), 1, undef, { tag => '', exit => 0 }); #$self->trace('results after Regexp::Group->scan', $self->{regexp}->getResults(), 1, undef, { tag => '', exit => 0 }); - return $result; + return $self->{regexp}->get_report(); } sub index {