in reply to Load a file into hash with duplicate keys

By definition, if the values in the first field in your first file are not unique, then that field cannot be a key.

This gives you basically two options: either normalize your file in such a way that these values are unique (a HashOfArrays will do the trick), or make the second field your key field (provided these values are unique).

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re: Load a file into hash with duplicate keys