in reply to Re^2: hash comparison
in thread hash comparison
Hi sarvan,
I think that if you study the code, you will find that you have all that you need. The last "foreach" loop is on the fancy side of things, but it just loops over all of the unique keys in a special sort order. $cand_histogram{$key}||='0' uses 0 as the value in the case that there is no value for $cand_histogram{$key}. The print statement prints the 3 things that you need in order to calculate what you want. Why don't you give some code a try? Post your effort back here after you study it a bit.