![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
POE, was Re: Tk tail -f - How?by RMGir (Prior) |
on Oct 09, 2003 at 10:47 UTC ( #297870=note: print w/replies, xml ) | Need Help?? |
Take a look at POE, specifically POE::Wheel::FollowTail and POE's Tk integration.
There's an example for POE::Wheel::FollowTail in the POE Cookbook, as well as a POE::Tk example.
You mentioned filtering, though. If you're going to have a lot of lines that you need to drop, you might want to use POE::Wheel::Run instead of FollowTail, and filter the lines in a helper process, using one of the tail -f techniques in the other replies. POE fires an event for every line of input, so if you're going to discard a lot of lines, it's cheaper to do it outside of the POE framework.
(Edit: I forgot to mention, you may want to try typing The technique described there should work on Win32 as well as anywhere else, but you'd also have to add a watch to simulate the --follow behaviour if the file is rotated.)
In Section
Seekers of Perl Wisdom
|
|