Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Diff on hashes

by djantzen (Priest)
on Nov 12, 2002 at 13:55 UTC ( #212260=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://212260]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2023-02-05 20:03 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (32 votes). Check out past polls.