$category_menu_btn = $category_menu_fr -> Menubutton( -width => 29, -bg => $bg_clr, -relief => 'raised' ) -> pack(-side => 'left', -pady => '1'); my $category_menu = $category_menu_btn -> Menu( -tearoff => 0, ); $category_menu_btn -> configure(-menu => $category_menu); foreach $choice (@categories) { $category_menu -> add('command', -label => $choice, -command => sub { $last_category = $choice; $category_menu_btn -> configure( -text => "$last_category", ); $changes_have_been_made = 1; }, ); } # next $choice.