in reply to Interrupting Tk repeat() method
P.S. One of the things I wish the repeat(after) object had was an $timer->is_running method. I always have to set a separate scalar manually to track them.
use strict; my $stop_flag = 0; my $timer; $timer = $mw->repeat(1000, sub{ #do something #check for stop_flag if( $stop_flag ){ $timer->cancel } });
|
|---|