File::LogReader - tail log files with state between runs
Tail log files across multiple runs over time.
use File::LogReader; my $lr = File::LogReader->new( filename => $filename ); while( my $line = $lr->read_line ) { # do stuff with $line } $lr->commit;
This module makes it easy to periodically check a file for new content and act on it. For instance, you may want to parse a log file whenever it is updated.
Create a new object. Options:
The name of the file to read from
A directory to store state files. Defaults to ~/.logreader
Return a single line of input from the file, or undef;
Saves the read position of the current file.
Luke Closs, <file-logreader at 5thplane.com>
<file-logreader at 5thplane.com>
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-LogReader. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc File::LogReader
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/File-LogReader
CPAN Ratings
http://cpanratings.perl.org/d/File-LogReader
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-LogReader
Search CPAN
http://search.cpan.org/dist/File-LogReader
Thanks to Matthew O'Connor for pairing on the locking.
Copyright 2007,2008 Luke Closs, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install File::LogReader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::LogReader
CPAN shell
perl -MCPAN -e shell install File::LogReader
For more information on module installation, please visit the detailed CPAN module installation guide.