Devel::Events::Match - Event matching, splicing and dicing.
version 0.09
use Devel::Events::Match; my $matcher = Devel::Events::Match->new; my @matching = $matcher->grep( match => $cond, events => \@events );
This class provides event list filtering, chunking etc based on a simple match format.
This class is used by Devel::Events::Handler::Log::Memory in order to ease access into the event log.
Used to compile condition values into code references.
Scalars become equality tests on the first element (event type/name matches this).
Hashes become recursive conditions, where each key is matched on the field. The 'type' pseudofield is the first element of the event. Every value in the hash gets compile_cond called on it recursively.
compile_cond
Code references are returned verbatim.
The output is a code reference that can be used to match events.
Return the first event that matches a certain condition.
Requires the match and events parameters.
match
events
Return the list of events that match a certain condition.
Return events between two events. If from or to is omitted then it returns all the events up to or from the other filter (from defaults to sub { 1 } and to defaults to sub { 0 }).
from
to
sub { 1 }
sub { 0 }
If either the from_inclusive and to_inclusive parameters are provided and set to false then the range will only begin on the event after the from match and end on the event before the to match respectively.
from_inclusive
to_inclusive
Requires the events parameter.
Cuts the event log into chunks. When $marker matches a new chunk is opened.
$marker
Requires the marker and events parameters.
marker
The first and last parameters, when provided and false will cause the first and last chunks to be dropped, respectively.
first
last
The first chunk contains all the events up to the first matching one.
Require the match and events parameters.
Bugs may be submitted through the RT bug tracker (or bug-Devel-Events@rt.cpan.org).
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
This software is copyright (c) 2007 by יובל קוג'מן (Yuval Kogman).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Devel::Events, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Events
CPAN shell
perl -MCPAN -e shell install Devel::Events
For more information on module installation, please visit the detailed CPAN module installation guide.