in reply to Re: Re: How to remove duplicate key/value pairs in hash of array
in thread How to remove duplicate key/value pairs in hash of array

You've got an array of items that you don't want to contain duplicates. If you store those items as the keys of a hash instead of as the elements of an array, then you will never have duplicates. That's one of the features of a hash.

So, instead of a hash of arrays, my suggestion is that you use a hash of hashes. When you want to get the list of ranks for a specific name, you would do: my @ranks = keys %{$HoH{$name}};

  • Comment on Re: Re: Re: How to remove duplicate key/value pairs in hash of array
  • Download Code