use Tk; use strict; $::cini_global = { trickle => { email_template_file => "nothing" }}; my $mw = MainWindow->new; $mw->Entry( -width => 40, -textvariable => \$::cini_global->{trickle}->{email_template_file} )->pack(qw/-expand 1 -fill x/); $mw->Button( -text => "Change", -command => sub { $::cini_global->{trickle}->{email_template_file} = $mw->getOpenFile(); })->pack; MainLoop;