pass arguments through to Listeners for processing with Getopt::Long
[lwes-perl.git] / LWES / Listeners / EventPrintingListener.pm
blobf23ff5205bf20633a4cf569cdb1347da7c99b795
1 package LWES::Listeners::EventPrintingListener;
3 use strict;
5 use LWES::Listener;
7 @LWES::Listeners::EventPrintingListener::ISA =
8 qw(LWES::Listener);
10 sub initialize {
11 # possible contents of function
12 # my $self = shift;
13 # my $args = shift;
14 # if (defined ($args)) {
15 # my @ARGV = @{$args};
16 # use Getopt::Long to parse additional command line options
17 # }
20 sub processEvent {
21 my $self = shift;
22 my $event = shift;
24 my $key_count = 0;
25 foreach my $key (keys %{$event})
27 $key_count++ if $key ne "EventType";
30 print ($event->{'EventType'}."[$key_count]\n{\n");
31 foreach my $key (sort(keys(%{$event})))
33 next if $key eq "EventType";
34 my $value = $event->{$key};
35 print("\t",$key," = ",$value,";\n");
37 print("}\n");