in reply to run command every x seconds

while (1) { # do something, then… sleep( $x ); # maybe do something else... }
In the context of a Tk GUI, you probably want to check out something called "Tk::after" (I'm not sure how to link to an online man page for that, but if you have Perl Tk installed, just run "perldoc Tk::after")

Replies are listed 'Best First'.
Re^2: run command every x seconds (Tk links)
by kcott (Archbishop) on Feb 27, 2014 at 07:56 UTC
Re^2: run command every x seconds
by amboxer21 (Sexton) on Feb 27, 2014 at 04:48 UTC

    Thanks this looks very promising. I am having a look now. I'd rather use metacpan than perldoc. https://metacpan.org/pod/Tk::after

      Dude, web sites of man pages are like processed sugar (and they vanish when connectivity goes away).

      Perldoc is salt of the earth, mother's milk, Popeye's Spinach, manna from heaven, food of the gods, chicken soup for the programmer's soul, Breakfast of Champions, … and it's ready to serve your reading pleasure pretty much whenever and wherever perl itself can run. You gotta love it.