in reply to Read file in a hash and compare the 'values' from file 2

Did you check what is in your %hash? I think you will find it does not contain the data as you expect.

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