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

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

by ikegami (Pope)
on Oct 01, 2013 at 13:47 UTC ( #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.


Comment on Re: Truly randomized keys() in perl 5.17 - a challenge for testing?
Select or Download Code
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
Node Status?
node history
Node Type: note [id://1056482]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-10-24 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls