Steffen Ullrich > Net-IMP-0.617 > Net::IMP::Filter

Download:
Net-IMP-0.617.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: Net-IMP-0.629

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

fatal($self,$msg)

this gets called on IMP_FATAL

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.

syntax highlighting: