eq applies scalar context to its operands. scalar(%hash) has a special meaning, search for "hash in scalar context" in
perldata. If you want to compare the contents, you'll
need to do something more complicated.
Data::Dumper, Storable, Test::More, and Test::Differences all do things that are close to what you want, but none seems a perfect fit (and you don't say if you just want to test the keys and values for equality or if you want to descend into the values themselves if they are complex structures.)
Boris's suggestion of Data::Compare seems to be what you want (assuming you want a deep compare or just have a simple hash). It's Compare function returns backward for my taste, though.