in reply to How ro read a file every 10 seconds?

I think that AnyEvent should do the trick.

use AnyEvent; sub loop { AnyEvent->timer (after => 10, cb => sub {<i>do_something_here</i>; &loop;}); loop();

Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.

Replies are listed 'Best First'.
Re^2: How ro read a file every 10 seconds?
by padawan_linuxero (Scribe) on May 12, 2008 at 19:40 UTC
    Thanks I will look this up

    really apreciated :)

      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) ); };