
Mail::Abuse::Report - Process an abuse report

use Mail::Abuse::Report;
my $r = new Mail::Abuse::Report
(
-text => \$report_text,
-reader => $reader,
-filters => [ $f1, $f2, ... ],
-parsers => [ $i1, $i2, ... ],
-processors => [ $p1, $p2, ... ],
-debug => 1,
-config => $config_file,
);

This class encapsulates an abuse report and provides methods to automate tasks such as extracting individual incidents from it, filtering the incidents, etc.
Each of the methods are described in detail, below:
->new(%args)Creates a new Mail::Abuse::Report object. It accepts the following arguments:
-textSpecifies the text that will be used to fill the report with. This is incompatible with -reader, so choose one and stick to it. Defaults to undef.
-readerSpecifies the object (tipically a member of Mail::Abuse::Reader) that will be used to fetch the text of the next report. This is incompatible with -text, so pick one and stick to it. Defaults to undef.
-filtersA reference to a list of objects that can filter incidents. Normally, objects based on Mail::Abuse::Filter. Defaults to no filters.
-parsersA reference to a list of objects that can parse incidents out of the report text. Normally, objects based on Mail::Abuse::Incident. Defaults to no parsers.
-processorsA reference to a list of objects that can process the incidents on the report, normally objects based on the Mail::Abuse::Processor class. Defaults to no processors.
-debugA true value causes diagnostic messages to be sent via warn().
-configSpecifies the name of the config file to fetch configuration items from. Can be left unspecified.
->next()When the object has a reader, fetches the next report text, parses it with the incidents and filters the incidents and processes them with the supplied processors.
Returns the report object if succesful or false otherwise.
If no reader has been supplied to the report object, the same text will be analyzed over and over again.
->flush()Discards all non-essential information from the object. It is meant to be called before reusing the object to process a new report.
This method is automatically called by ->next.
Also, a number of acccessor methods are defined as follows:
->filtersWhen invoked without arguments, returns a reference to the list of filters (Mail::Abuse::Filter objects) attached to this abuse report. Calling the accessor with a list of objects will replace whatever was the prior list.
The list can be manipulated, affecting the object directly.
->incidentsWhen invoked without arguments, returns a reference to the list of incidents extracted from this report (Mail::Abuse::Incident objects). Calling the accessor with a reference to a list of objects will replace whatever was the prior list.
The list can be manipulated, affecting the object directly.
->parsersWhen invoked without arguments, returns a reference to the list of parsers that are used in this report (Mail::Abuse::Incident objects). Calling the accessor with a reference to a list of objects will replace whatever was the prior list.
The list can be manipulated, affecting the object directly.
->processorsWhen invoked without arguments, returns a reference to the list of processors attached to this report (Mail::Abuse::Processor objects). Calling the accessor with a reference to a list of objects will replace whatever was the prior list.
The list can be manipulated, affecting the object directly.
->textAccepts a reference to a scalar containing the text of the report.
Returns a reference to the text of the report.
If the text is altered, you should call ->flush() to avoid insanity.
->readerIf passed a reader object, it will replace the one used for initialization. Otherwise, will return the reader object passed to ->new.
->configReturns a reference to a hash containing the configuration information read-in by this report. It can be replaced by simply supplying a new reference to a configuration hash.
->debugReturns the debug level of the object. When set to true, debug information is issued through warn.
None by default.

Original version; created by h2xs 1.2 with options
-ACOXcfkn
Mail::Abuse
-v
0.01

This code is distributed under the same terms as Perl itself, providing the exact same warranty.

This code and all accompanying software comes with NO WARRANTY. You use it at your own risk.
This code and all accompanying software can be used freely under the same terms as Perl itself.

This code and all accompanying software comes with NO WARRANTY. You use it at your own risk.
This code and all accompanying software can be used freely under the same terms as Perl itself.

Luis E. Muñoz <luismunoz@cpan.org>

perl(1).