in reply to TK, insert and foreach
Update: or try something like this:
use File::Tail; use Tk; use warnings; use strict; my $filename = "$ENV{HOME}/.xsession-errors"; my $log = File::Tail::->new(name => $filename, interval => 1, nowait => 1, ); my $mw = MainWindow->new(-title => "Log Watch"); my $t = $mw->Scrolled("Text")->pack; $t->insert("end","== Started at ".localtime); $mw->repeat(1000, sub { my $line = $log->read; $t->insert("end",$line) if defined $line; }); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TK, insert and foreach
by papaismurf (Novice) on Jun 23, 2011 at 20:28 UTC |