in reply to Re^2: get the average of hash values?
in thread get the average of hash values?

I don't understand. The OP wants an average for each of 'A', 'B', 'C', 'D' (four numbers). Your input (%hash) doesn't have the information to do that, and your output (a ratio, called '$sum') is a single number.