in reply to Tk tail -f - How?
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.
--
Mike
(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.)perldoc -q "tail -f"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: POE, was Re: Tk tail -f - How?
by msemtd (Scribe) on Oct 09, 2003 at 12:22 UTC | |
by BrowserUk (Patriarch) on Oct 09, 2003 at 12:43 UTC | |
by msemtd (Scribe) on Oct 09, 2003 at 13:38 UTC | |
by BrowserUk (Patriarch) on Oct 09, 2003 at 18:01 UTC | |
by rcaputo (Chaplain) on Oct 09, 2003 at 14:37 UTC |
In Section
Seekers of Perl Wisdom