Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Truly randomized keys() in perl 5.17 - a challenge for testing?

by ikegami (Patriarch)
on Oct 01, 2013 at 13:47 UTC ( [id://1056482]=note: print w/replies, xml ) Need Help??


in reply to Truly randomized keys() in perl 5.17 - a challenge for testing?

which means that even within the same process, calling keys() twice on the same hash will result in a different key order.

That's not what it means at all. For a given hash, multiple calls to keys (and values) are still guaranteed to return the same order if there has been no change to the hash, and the order has always been subject to change after hash modifications.

Difference one: The order is more likely to change on hash modification.

Difference two: In a given interpreter, if you built two hashes using identical insert and delete steps, you used to get the same key orderings. This is not always the case now.

Replies are listed 'Best First'.
Re^2: Truly randomized keys() in perl 5.17 - a challenge for testing?
by saintmike (Vicar) on Oct 02, 2013 at 14:49 UTC
      You are mistaken. That file never calls keys twice on the same hash. It call keys on two different hashes (containing the same data). That code has been buggy since 5.8.1. The bug is just more likely to occur now.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-29 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found