Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Deterministic or keys in random order

by psini (Deacon)
on May 14, 2008 at 13:19 UTC ( #686508=note: print w/replies, xml ) Need Help??

in reply to Deterministic or keys in random order

It isn't random id that sense of word.

Any given instance of a hash variable has an intrinsic order which is mantained until the hash is modified. So if you repeatedly check the first result of keys on the same hash you'll find always the same key

The order of the keys is "random" in the sense that it is not (easily) predictable; if you add a new key to the hash it could be in any position.

Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-12-05 08:00 GMT
Find Nodes?
    Voting Booth?

    No recent polls found