sub refresh_func{ $autorefresh_id->cancel(); #cancel the timer #.... do stuff ... $autorefresh_id = $root->repeat($rinterval*60000,\&refresh_func); #recreate the timer }