> I'll try reducing a problem to a few lines, within this week.

Actually CODE refs are destroyed too early in a quite simple scripts. Even
following code has a problem and gives error about unreferenced scalar and
"not a CODE reference":

use strict;

use Tcl::Tk;
my $int = new Tcl::Tk;

$int->Eval(<<'EOS');
pack [button .btn -text Go]
EOS

my %wids;

my $btn = $int->widget('.btn');
$btn->configure(-command=>sub {
    print STDERR "start processing...\n";
    print STDERR sort keys %wids, "\n";
});

$int->MainLoop;


Interestingly, when I comment second "print" statement within anonymous sub,
error goes away: CODE  destruction is not fast enough in this case.

Now I wonder, is it only CODE refs problem, or more general problem with
references?

Vadim.

Reply via email to