App::RabbitTail::FileTailer - responsible for tailing a file and invoking a callback for each line.
use App::RabbitTail::FileTailer; use AnyEvent; my $tailer = App::RabbitTail::FileTailer->new( backoff_increment => 0.1, max_sleep => 10, fn => $somefile, cd => sub { warn("Got line " . $_[0]) }, ); $tailer->tail; # Sets up watcher to fire callbacks, returns # Rest of your code. # Enter event loop. AnyEvent->condvar->recv;
An instance of App::RabbitTail::FileTailer manages tailing a file with exponential backoff of checking if the file has been written when no bytes are available to minimise system load.
See App::RabbitTail for copyright and license.
To install App::RabbitTail, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::RabbitTail
CPAN shell
perl -MCPAN -e shell install App::RabbitTail
For more information on module installation, please visit the detailed CPAN module installation guide.