in reply to Re^3: what is difference between calling the function in Perl/Tk in the following ways
in thread what is difference between calling the function in Perl/Tk in the following ways
the other one would probably leak also if they both contain $button
Exactly.
my $obj; my $obj = { data => [ \&f, \$obj ] }; # leaks my $obj; my $obj = { data => [ sub { f($obj) } ] }; # leaks my $arg; my $obj = { data => [ \&f, \$arg ] }; # doesn't leak my $obj; my $obj = { data => [ sub { f($arg) } ] }; # doesn't leak
|
|---|