Pcore::Core::Event - Pcore event broker
P->listen_events( [ 'TEST1', 'TEST2.*.LOG', 'TEST3.#' ], # listen masks sub ( $ev ) { # callback say dump $ev->{key}; say dump $ev->{data}; return; }, 'stderr:', # pipe [ 'stderr:', tmpl => "<: \$key :>$LF<: \$text :>" ], # pipe with params [ 'file:123.log', tmpl => "<: \$key :>$LF<: \$text :>" ], # pipe with params ); P->fire_event( 'TEST.1234.AAA', $data );
$key - event key, special symbols can be used:
* (star) can substitute for exactly one word;
# (hash) can substitute for zero or more words;
where word is /[^.]/
To install Pcore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pcore
CPAN shell
perl -MCPAN -e shell install Pcore
For more information on module installation, please visit the detailed CPAN module installation guide.