my %solutionMatrix; my $defaultPlatform = "Mod1"; $solutionMatrix{"Mod1"} = [ 'a','b','c' ]; $solutionMatrix{"Mod2"} = [ 'q' ]; my $platformDropdown = $selectionFrame -> Optionmenu ( -textvariable => \$platformChoice, -indicatoron => 1 ) -> pack( -side => "left"); # --- now populate the options in the platform and customer dropdown list, # which is in the hash of arrays, %solutionMatrix foreach my $platform ( sort keys %solutionMatrix ) { # $platform is a choice for the platform dropdown # @{$solutionMatrix{$platform} is an array of solutions for the customer dropdown $platformDropdown -> addOptions([$platform=>$platform]); } $platformChoice = $defaultPlatform; # set default $platformDropdown -> configure( -textvariable => \$platformChoice );