Win32::FirewallParser - Microsoft Windows XP SP2 Firewall Log Parser


Win32-FirewallParser documentation  | view source Contained in the Win32-FirewallParser distribution.

Index


NAME

Top

Win32::FirewallParser - Microsoft Windows XP SP2 Firewall Log Parser

SYNOPSIS

Top

 use Win32::FirewallParser;

 my $obj = new Win32::FirewallParser;

 $obj->setHandler(\&printLine);
 $obj->parseFile();

 sub printLine {
      my $data = shift;

      for my $key (keys %{$data}) {
           printf "%10s => %s\n", $key, $data->{$key};
      }

      print "\n";
 }

DESCRIPTION

Top

Simple module for parsing Microsoft Windows XP SP2 Firewall log files.

CONSTRUCTOR

Top

new ()

No constructor parameters required.

METHODS

Top

setHandler ( HANDLER )

This method sets a handler in which a subroutine can be called per line in the log file. For backwards compatibility purposes, this method can still be used, although using the setHandler() member function will cause the package to override any previously set handlers. To add to the list of handlers, use the addHandler() member function instead.

The handler subroutine takes one parameter, a hash reference, which contains the data of the current line in the log that the parser is up to.

addHandler ( HANDLER )

Adds a handler function to the list of handlers to be called for each line in the log file. To override any previous handler functions, use the setHandler() member function instead.

The handler subroutine takes one parameter, a hash reference, which contains the data of the current line in the log that the parser is up to.

removeHandler ( HANDLER )

Removes a handler function from the list. A reference to the callback function is expected as a parameter.

parseFile ( [FILENAME] )

Start parsing a file. If no parameter is specified, the default log file path using the environmental variable SystemRoot, %SystemRoot%/pfirewall.log, will be used.

AUTHOR

Top

Luke Triantafyllidis <ltriant@cpan.org>

COPYRIGHT

Top

CHANGELOG

Top

 2005-11-07 0.01  Beta release.
 2006-03-24 0.02  Added tests, fixed POD errors, added multiple handler suppport.
 2009-04-02 0.03  Fixed no_pod_errors.t to check if Test::Pod is available first.


Win32-FirewallParser documentation  | view source Contained in the Win32-FirewallParser distribution.