http://www.perlmonks.org?node_id=212260


in reply to Diff on hashes

There are several CPAN modules that I think will do what you need. Perhaps Data::Compare or Class::MakeMethods::Utility::Ref will do the trick. Long ago there was Ref, but I think that has gone away

Update: Hmm, actually you need more than what those can do. Perhaps you could use one of the above to test whether the structure has changed, and if it has you could grep the keys of the two versions to see which keys are different. Of course that means keeping around two copies of the "same" hash -- one for control and the other for actual use -- but it sounds like you mean to do that anyway.

Update 2: Check out Dominus's Tie::HashHistory which provides a kind of journalling hash.