NAME
Text::Parser::Manual::CollectedExamples - A collection of examples using Text::Parser
VERSION
version 1.000
SIMPLE EXAMPLES
Log statistics
use strict;
use Text::Parser;
my $parser = Text::Parser->new();
$parser->BEGIN_rule(
do => '~errors = 0; ~warnings = 0; ~fatal = 0; ~info = 0;'
);
$parser->add_rule(
if => '$1 eq "ERROR:"',
do => '~errors++;',
dont_record => 1,
);
$parser->add_rule(
if => '$1 eq "WARNING:"',
do => '~warnings++;',
dont_record => 1,
);
$parser->add_rule(
if => '$1 eq "INFO:"',
do => '~info++;',
dont_record => 1,
);
$parser->add_rule(
if => '$1 eq "FATAL:"',
do => '~fatal++;',
dont_record => 1,
);
$parser->read('/path/to/logfile.log');
my (%log_stats) = $parser->stashed;
COMPLEX EXAMPLES
This is a stub...
INVITATION TO CONTRIBUTE
You're invited to contribute your examples of how you use this package. Contributions will be acknowledged.
BUGS
Please report any bugs or feature requests on the bugtracker website http://github.com/balajirama/Text-Parser/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHOR
Balaji Ramasubramanian <balajiram@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018-2019 by Balaji Ramasubramanian.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.