in reply to Subroutine Memory Leak
What does this do for you? Does it leak in this case?
use Tk; use strict; my $var = 20; my $mw = MainWindow->new(); $mw->geometry("240x200"); my $leaking_label = $mw->Label( -textvariable => \$var, -font => q{arial 14 bold} )->place( -x => 100, -y => +50, -anchor => q{nw} ) ->pack; &startloop( \$var ); MainLoop; sub startloop { my ($v) = @_; my $iid; $iid = $mw->repeat( 1500, sub { autorefresh($v) } ); return; } sub autorefresh { my ($v) = @_; $$v += 20; }
HTH.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutine Memory Leak
by gopika77 (Initiate) on Jul 31, 2006 at 06:05 UTC |