use threads; use threads::shared; use Tk; # If these two hashes are shared (as below), the Entry widget displays # "Original"; if they are not shared, the widget displays "Changed". # %top_hash; # %hash; share(%top_hash); share(%hash); $top_hash{A} = \%hash; $top_hash{A}{B} = 'Original'; $t = MainWindow->new()->Scrolled('Text')->pack(); $e = $t->Entry(-textvariable => \$top_hash{A}{B}); $t->windowCreate('end', -window => $e); $t->insert('end', "\n"); $top_hash{A}{B} = 'Changed'; MainLoop;