File-Tail

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

The File::Tail module is designed for reading files which are continously
appended to (the name comes from the tail -f directive). Usualy such files are
logfiles of some description.

The module tries hard not to busy wait on the file, dynamicaly calcultaing 
how long it should wait before it pays to try reading the file again.

The module should handle normal log truncations ("close; move; open"
or "cat /dev/null >file") transparently, without losing any input.

Currently this package requires Time::HiRes, because it often needs to sleep
for less than one second. (I don't beleive one should busy wait on a file
just because it gets more than one line/second).

The file logwatch is a simple example of use. Try it with 
./logwatch /var/log/syslog 1 if you want to see how File::Tail works.

This version now returns a tied filehandle, but it can also be used as 
a normal object.



( run in 0.568 second using v1.01-cache-2.11-cpan-0a6323c29d9 )