my $button1 = $mw->Button(-text => 'Update Values', -command => sub{LoadNewValues(\%MyValues)})->pack(); sub LoadNewValues { my $href = shift; $href->{1} = "hallo"; #hash slice syntax also possible $href->{2} = "ok"; $href->{3} = "fine"; }