in reply to print identical keys once along with their values

What have you tried? What didn't work? Without seeing what you've tried, it's very hard to help you debug your approach. See How do I post a question effectively?

Rather than just using a hash, you want to use a hash of arrays, because you want to associate each key with multiple values. In this case, you might even want to use an Array of Arrays, since your keys are numeric. See HASHES OF ARRAYS in perldsc, and maybe perllol, perldata, perlreftut, and/or perlref for additional info.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

  • Comment on Re: print identical keys once along with their values

Replies are listed 'Best First'.
Re^2: print identical keys once along with their values
by soonix (Chancellor) on Nov 05, 2015 at 09:11 UTC
    As this signature is one of the best piece of advice in this field: is there a more complete collection than this newsgroup posting, apparently from dominus - perhaps even a canonical one?
      My Google skills are as extensive as yours. When I adopted the quote, I did a lot of digging to see if there were longer versions of the list, and found none.

      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.