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
In reply to Re: using perl to format tail -f
by oko1
in thread using perl to format tail -f
by danmcb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |