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


in reply to Watch log for string (tail -f)

hmb104:

"Not working" isn't particularly helpful. What is it doing? Any error messages, etc.?

Anyway, here's how I process the a log file with tail -f:

#!/usr/bin/perl use strict; use warnings; open my $FH, 'tail -f t |' or die; while (<$FH>) { chomp; # processing goes here.... }

...roboticus

When your only tool is a hammer, all problems look like your thumb.