foreach(keys %{$test{$type}}){ $optionmenu->addOptions([$test{$type}{$_}=>$_]); }