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

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

by jeroenes (Priest)
on Jun 20, 2001 at 18:40 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-03-29 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found