use strict; use warnings; use Tk; require Tk::BrowseEntry; my @items = qw(check0 check1 check2); my $mw = MainWindow->new(); my $default_choice = "check0"; my $dropDown = $mw->BrowseEntry( -label=>'item list', -variable=>\$default_choice, -browsecmd=>\&run )->pack(); $dropDown->insert('end', "check0"); $dropDown->insert('end',"check1"); $dropDown->insert('end',"check2"); $mw->Button(-text=>'exit', -command=>sub{exit;})->pack(); MainLoop; sub run{ my $x = 0; foreach my $element (@items){ print $element eq lc($default_choice)? "$default_choice index [$x]\n" : next; $x++; } }