#!/usr/bin/env perl use warnings; use strict; while(<>) { #... do something with the latest line, $_ } #### tail -f /var/log/apache2/access.log | myscript.pl