saintmike has asked for the wisdom of the Perl Monks concerning the following question:
Venerable monks,
someone just told me that their perl (v5.8.1-RC3/darwin) stored hashes differently between different invocations of a program. Now, while we certainly can't rely on the 'order' in which hash entries are stored, I was assuming (until now) that the 'order' was at least consistent.
But it turns out that multiple calls to
produce different output on this platform, like this:$ perl -e '%a=(1=>"a",2=>"b",3=>"c"); print %a,"\n"'
Does anybody know if there's a random generator in the hash algorithm of some perl implementations?2b3c1a 3c1a2b ...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Randomizing Hash Implementation?
by tilly (Archbishop) on Apr 10, 2005 at 00:06 UTC | |
Re: Randomizing Hash Implementation?
by dave_the_m (Monsignor) on Apr 10, 2005 at 00:10 UTC | |
Re: Randomizing Hash Implementation?
by nobull (Friar) on Apr 10, 2005 at 00:15 UTC | |
Re: Randomizing Hash Implementation?
by tlm (Prior) on Apr 10, 2005 at 00:11 UTC | |
Re: Randomizing Hash Implementation?
by Anonymous Monk on Apr 10, 2005 at 01:30 UTC | |
by ikegami (Patriarch) on Apr 10, 2005 at 05:19 UTC |
Back to
Seekers of Perl Wisdom