use Tk; use strict; my $var=20; my $mw = MainWindow->new(); $mw->geometry( "240x200" ); $mw->Label(-text=>"Subroutine Memory Leak")->pack; &startloop; MainLoop; sub startloop { my $iid; $iid = $mw->repeat( 1500,\&autorefresh) ; return; } sub autorefresh { $var= $var + 20; $mw->Label(-text=>"$var",-font=>'arial 14 bold')->place(-x =>100,-y =>50,-anchor => 'nw'); return; }