http://www.perlmonks.org?node_id=680334


in reply to Re: using perl to format tail -f
in thread using perl to format tail -f

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