use strict; use warnings; use Tk; use Tk::BrowseEntry; my %CFG = ( 'target' => 'foobar' ); my $main = MainWindow->new(); my $entry = $main->BrowseEntry( -variable=>\$CFG{target}, ); $entry->grid( -row=>1, -column=>1, ); my $continue = $main->Button( -command=>\&continue, -text=>'run', ); $continue->grid( -row=>2, -column=>1, ); sub continue { warn "$CFG{target}\n"; if ( $CFG{target} =~ s/bar//xms ) { warn "expecting this message\n"; } warn "$CFG{target}\n"; } MainLoop();