in reply to Re: How ro read a file every 10 seconds?in thread How ro read a file every 10 seconds?
Or you can set a repeat on the main window.....
use Tk; my $SLEEP = 1000; # msec my $mw = new MainWindow; $mw->title('Clock'); my $text = $mw->Text( -width => 25, -height => 2 )->pack; $mw->Button( -text => " Start! ", -command => sub { $mw->repeat($SLEEP,\&change_label) } )->pack; MainLoop; sub change_label { $text->delete('1.0','end'); $text->insert('end', (scalar localtime) ); }; [download]