my %solutionMatrix; # hash of lists that contain platforms and customer variants per platform my $defaultPlatform = "Mod1"; # the default platform, selected at program start $solutionMatrix{"Mod1"} = [ 'a','b','c' ]; # store the list address in the hash for default key $solutionMatrix{"Mod2"} = [ 'q' ]; # another platform 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 to default value