use File::Tail; $file=File::Tail->new("/var/log/maillog"); while (defined($line=$file->read)) { print "$line"; }