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.
-
$watcher = File::Tail::Inotify2->new( file => $filename, on_read => $cb->($read_line) )
Returns a File::Tail::Inotify2 object. If
$filename
is modified,$cb->($read_line)
is called per line. -
$watcher->poll
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.