File::Tail::Inotify2 - Simple interface to tail a file using inotify.
use File::Tail::Inotify2; my $watcher = File::Tail::Inotify2->new( file => $filename, on_read => sub { my $line = shift; print $line; } ); $watcher->poll;
Yet another module to tail a file. Even if the file are renamed by logrotate(8), this module tail a new file created by logrotate(8).
This module works on Linux. Other OS are not supported.
Returns a File::Tail::Inotify2 object. If $filename is modified, $cb->($read_line) is called per line.
$filename
$cb->($read_line)
Starts watching a file and will never exit.
Linux::Inotify2, File::Tail, File::SmartTail, Tail::Tool
Yoshihiro Sasaki, <ysasaki at cpan.org>
Copyright (C) 2012 by Yoshihiro Sasaki
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install File::Tail::Inotify2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Tail::Inotify2
CPAN shell
perl -MCPAN -e shell install File::Tail::Inotify2
For more information on module installation, please visit the detailed CPAN module installation guide.