use Tie::Judy; tie %fruit_color, 'Tie::Judy'; #### my %fruit_color = ("apple", "red", "banana", "yellow"); #### my %fruit_color = ( apple => "red", banana => "yellow", ); #### $fruit_color{"apple"}; # gives "red" #### my @fruits = keys %fruit_color; my @colors = values %fruit_color;