in reply to using perl to format tail -f

You can just pipe the output from tail -f to perl: tail -f /var/log/apache2/access.log | perl -pe 's/ /\t/g'

This tail -f's the apache log file, and replaces each space with a tab (useless, but it shows how you can do it).

And of course there's File::Tail on CPAN:

Replies are listed 'Best First'.
Re^2: using perl to format tail -f
by perlfan (Parson) on Apr 14, 2008 at 16:41 UTC
    Or to a script:
    #!/usr/bin/env perl use warnings; use strict; while(<>) { #... do something with the latest line, $_ }
    Usage:
    tail -f /var/log/apache2/access.log | myscript.pl