Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re:{2} How to test equality of hashes?

by jeroenes (Priest)
on Jun 20, 2001 at 18:40 UTC ( #90012=note: print w/replies, xml ) Need Help??

in reply to Re: How to test equality of hashes?
in thread How to test equality of hashes?

There is no way Storable can garantee the order of your hashes. You could use slices to assure an order, but that doesn't work for nested structures. Moreover, only references to objects are allowed, destroying the order of the slices.

Update: Missed a part of the Storable manpage. Ignore my comment please

Replies are listed 'Best First'.
Re: How to test equality of hashes?
by bikeNomad (Priest) on Jun 20, 2001 at 18:51 UTC
    I'm not sure what you're saying. I'm not expecting Storable to guarantee anything other than that it'll serialize hashes by sorted key order, which is what setting $Storable::canonical to true is supposed to do. From the Storable manpage:

    If you set $Storable::canonical to some TRUE value, Storable will store hashes with the elements sorted by their key. This allows you to compare data structures by comparing their frozen representations (or even the compressed frozen representations), which can be useful for creating lookup tables for complicated queries.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://90012]
and the fog begins to lift...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2018-04-20 11:10 GMT
Find Nodes?
    Voting Booth?