use strict; use warnings; use Tk; use Tk::MatchEntry; my %data = ( a => [qw/Abberley Abberton Abbotsley Accrington/], b => [qw/Babraham Bacton Bexhill Bradfield/] ); my $place; my $mw = MainWindow->new (-title => "i wish this would work",); $mw->geometry ("200x70+0+0"); my $label = $mw->label ("type somthing in the box"); my $me = $mw->MatchEntry ( -textvariable => \$place, -choices => [keys %data], -autosort => 0, -fixedwidth => 0, -ignorecase => 1, -maxheight => 10, -listwidth => 240, -onecmd => \&repopulate, )->pack (-side => 'left'); Tk::MainLoop (); sub repopulate { return unless exists $data{lc $place}; $me->configure (-choices => $data{lc $place}); }