# BrowseEntry, entry with listbox to select list values. use strict; use warnings; use Tk; use Tk::BrowseEntry; my $month = "January"; my $top = MainWindow->new; my $f = $top->Frame->pack; my $top_f = $f->Frame(-bg=>'red', -width=>'200')->pack; my $bot_f = $f->Frame(-bg=>'red', -width=>'200')->pack; my $c = $top_f->BrowseEntry(-label => "Month:", -variable => \$month); $c->pack; $c->insert("end", "January"); $c->insert("end", "February"); $c->insert("end", "March"); $c->insert("end", "April"); $c->insert("end", "May"); $c->insert("end", "June"); $c->insert("end", "July"); $c->insert("end", "August"); $c->insert("end", "September"); $c->insert("end", "October"); $c->insert("end", "November"); $c->insert("end", "December"); $bot_f->Button(-text => "Print value", -command => sub { print "The month is $month\n"; $top_f->destroy if Tk::Exists($top_f); }, -relief => "raised")->pack; MainLoop;