http://qs321.pair.com?node_id=297870


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

perldoc -q "tail -f"
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.)