NAME
Net::IMP::Filter - simple data filter using Net::IMP analyzers
SYNOPSIS
package myFilter;
use base 'Net::IMP::Filter';
sub out {
my ($self,$dir,$data) = @_;
print "[$dir] $data\n";
}
package main;
use Net::IMP::Pattern;
my $factory = Net::IMP::Pattern->new_factory...;
my $f = myFilter->new( $factory->new_analyzer );
..
$f->in(0,$data0);
$f->in(1,$data1);
..
DESCRIPTION
Net::IMP::Filter
is a class which can be used for simple filters (e.g. data in, data out) using Net::IMP analyzers, thus hiding the complexity but also useful features of the Net::IMP interface for simple use cases. To create such a filter subclass from Net::IMP::Filter
and implement any of the following methods (which by default do nothing)
- out($self,$dir,$data)
-
this gets called for output of data
- deny($self,$msg,$dir)
-
this gets called on IMP_DENY
- log($self,$level,$msg,$dir,$offset,$len)
-
this gets called on IMP_LOG
- acctfld($self,$key,$value)
-
this gets called on IMP_ACCTFIELD
AUTHOR
Steffen Ullrich <sullr@cpan.org>
COPYRIGHT
Copyright by Steffen Ullrich.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.