in reply to using perl to format tail -f

One way is to open 'tail -f' as a 'read-from' filehandle within your script, as documented in perlopentut.

open Tail, '/usr/bin/tail -f /my/log/file |' or die "Pipe failed: $!\n +"; while (<Tail>){ # Do stuff }

-- 
Human history becomes more and more a race between education and catastrophe. -- HG Wells

Replies are listed 'Best First'.
Re^2: using perl to format tail -f
by MidLifeXis (Monsignor) on Apr 14, 2008 at 17:47 UTC

    IIRC, on some platforms, "tail -f" may buffer the output so that you will get batches of output rather than real-time output.

    This is only on some platforms, and other versions will have a flag to disable buffering.

    Just a tidbit that may effect your results.

    --MidLifeXis