App::PerlWatcher::Watcher::FileTail - Watches for changes file and outputs new added lines (a-la 'tail -f')
version 0.18
Use the following config for Engine to monitor file changes online:
{ class => 'App::PerlWatcher::Watcher::FileTail', config => { file => '/var/log/messages', lines_number => 10, filter => sub { $_ !~ /\scron/ }, }, },
The more detailed description of PerlWatcher application can be found here: https://github.com/basiliscos/perl-watcher.
The file to be watched.
The number of at the file tail, which are to be displayed
The function, which will filter file tail lines, which will not be displayed/taken into account, e.g.
sub { $_ !~ /\scron/ }
- that omits all lines with 'cron' string
The inotify object
All gathered lines
Emits lines in revers order, like tail -f, i.e. the new ones come at the top.
Default value: false
Ivan Baidakou <dmol@gmx.com>
This software is copyright (c) 2014 by Ivan Baidakou.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::PerlWatcher::Watcher::FileTail, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::PerlWatcher::Watcher::FileTail
CPAN shell
perl -MCPAN -e shell install App::PerlWatcher::Watcher::FileTail
For more information on module installation, please visit the detailed CPAN module installation guide.