Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: Hash order randomization is coming, are you ready?

by demerphq (Chancellor)
on Dec 02, 2012 at 10:03 UTC ( #1006691=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Hash order randomization is coming, are you ready?
in thread Hash order randomization is coming, are you ready?

Yes indeed. This cannot change. And is guaranteed by the nature of the how keys() and values() are implemented in native hashes (non-magical). Basically they are both achieved by walking the bucket array from left to right and within a bucket from top to bottom. Since they both do the same data structure walk they both return the same results. However note this is true only of a /given/ hash. You can't assume that one hashes keys() will match another's values() even if they contain the same list of keys().

---
$world=~s/war/peace/g


Comment on Re^4: Hash order randomization is coming, are you ready?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-09-20 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls