in reply to Re: Hashes aren't being differently randomized
in thread Hashes aren't being differently randomized
Perl has never guaranteed any ordering of the hash keys, and the ordering has already changed several times during the lifetime of Perl 5. Also, the ordering of hash keys has always been, and continues to be, affected by the insertion order.Also note that while the order of the hash elements might be randomised, this "pseudoordering" should not be used for applications like shuffling a list randomly (use List::Util::shuffle() for that, see List::Util, a standard core module since Perl 5.8.0; or the CPAN module Algorithm::Numerical::Shuffle), or for generating permutations (use e.g. the CPAN modules Algorithm::Permute or Algorithm::FastPermute), or for any cryptographic applications.
greets,
--shmem
_($_=" "x(1<<5)."?\n".qキ/)Oo. Gー\ /
/\_ッ/(q /
---------------------------- \__(m.====キ.(_("always off the crowd"))."キ
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hashes aren't being differently randomized
by vkon (Curate) on Jun 26, 2006 at 18:44 UTC | |
by shmem (Chancellor) on Jun 26, 2006 at 18:46 UTC |