NAME
ACL::Regex - Process arbitrary events with regular expressions.
SYNOPSIS
use ACL::Regex;
# Instantiate a reject object
my $reject_acl = ACL::Regex->new->
generate_required( 'required.txt' )->
parse_acl_from_file( { Filename => "acl.reject.txt" } );
while( <> ){
chomp;
my ($rc,$regex,$comment) = $reject_acl->match( $_ );
if( $rc ){
print "\t! Rejected against $regex\n";
print "\t: Reason: $comment\n";
next;
}
}
DESCRIPTION
ACL::Regex allows you to parse a series of actions, key/value pairs through an object containing a series of regular expressions.
OBJECT ORIENTED INTERFACE
The module is written with an object oriented interface. There is no function interface to choose from. To streamline many of the initial operations of the object, many of the initialization methods return the object reference, allowing the programmer to chain the commands together.
- :generate_required
-
This method pulls in a :file containing a series of required keys.
- :sanitize_acl
-
This method re-sorts the keys in alphabetical order.
- :sanitize_action
-
This method accomplishes the same thing as :sanitize_acl but for actions.
- :parse_acl_from_file
-
This method takes a hash as a parameter:
parse_acl_from_file( { Filename => "acl.reject.txt" } )
- :match
-
This method takes an action as a parameter, and returns a triplet containing the return code, matched regex, and any comment associated with the regex.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 197:
=over without closing =back