Which makes me wonder whether your meditation isn't a little a) redundant; b) slightly scare mongery?
I think you missed the point. The order will change *every process*.
$ for i in {1..10}; do ./perl -le'%h=(1..20); print "$]: ",join "-", k
+eys %h'; done;
5.017007: 1-13-5-15-19-9-17-11-7-3
5.017007: 13-19-5-17-9-15-1-7-3-11
5.017007: 13-7-19-15-5-1-11-17-3-9
5.017007: 17-13-3-7-15-1-9-5-11-19
5.017007: 17-9-3-11-7-15-1-19-5-13
5.017007: 19-1-11-5-9-3-15-17-7-13
5.017007: 9-19-3-17-7-11-13-15-1-5
5.017007: 1-11-15-3-19-17-7-13-9-5
5.017007: 19-7-13-1-5-17-9-3-11-15
5.017007: 5-19-9-1-13-17-7-3-15-11
$ for i in {1..10}; do perl -le'%h=(1..20); print "$]: ",join "-", key
+s %h'; done;
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
5.012004: 11-3-7-9-17-15-1-19-13-5
The order returned by 5.12.4 is what you should see on pretty much every modernish perl there has been released with the exception of 5.8.1 and 5.17.6 and later. And obviously in 5.17.6 the order changes pretty much every time.
What we discover when we per-process randomize the keys is that people actually depend on the key order more than they realize. When we make it random these dependencies become visible as bugs. I tend to consider them buggy originally, as minor changes to the history of the hash will produce roughly the same results as per-process randomization.
BTW, you *did* see that I said "none of this is new" right? So why the emphasis on "But that has always been the case"?
---
$world=~s/war/peace/g
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|