use Tk; my %current = (pilot => 'Harry'); my $mw = MainWindow->new; $mw->geometry('200x200'); my $ent = $mw->Entry( -textvariable => \$current{pilot}, )->pack; my $btn = $mw->Button( -text => 'New Pilot', -command => \&update, )->pack; MainLoop; sub update{ # This works $current{pilot} = 'Tom'; # This does not work %current = (pilot => 'Tom'); # So update the entire hash this way my %newstuff = (pilot => 'Tom', copilot =>'Dick', etc => 'Harry'); for (keys %newstuff){ $current{$_} = $newstuff{$_}; } }