NAME
File::LogReader - tail log files with state between runs
SYNOPSIS
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;
DESCRIPTION
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.
METHODS
new
Create a new object. Options:
- filename
-
The name of the file to read from
- state_dir
-
A directory to store state files. Defaults to ~/.logreader
read_line
Return a single line of input from the file, or undef;
commit
Saves the read position of the current file.
AUTHOR
Luke Closs, <file-logreader at 5thplane.com>
BUGS
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.
SUPPORT
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
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2007 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.