P is for Practical | |
PerlMonks |
Re: removing lines from a fileby izut (Chaplain) |
on Jun 22, 2005 at 18:54 UTC ( [id://469129]=note: print w/replies, xml ) | Need Help?? |
You have some alternatives for this task, but have to see this points: - will the log file be rotated? - can the application is writing the log write to a fifo? If you do the fifo alternative, be careful to some log rotate application DO NOT rotate the fifo. Using the fifo you can easily dismiss the lines you don't want to store. If the application can output to STDOUT, you can redirect STDOUT to SDERR and read it (as STDIN is buffered) and then dismiss all lines you don't bother.
In Section
Seekers of Perl Wisdom
|
|