Change 19866 by [EMAIL PROTECTED] on 2003/06/27 08:54:16
Some warnings about the (im)proper uses of the hash randomisation.
Affected files ...
... //depot/perl/pod/perlsec.pod#28 edit
Differences ...
==== //depot/perl/pod/perlsec.pod#28 (text) ====
Index: perl/pod/perlsec.pod
--- perl/pod/perlsec.pod#27~19854~ Wed Jun 25 22:32:02 2003
+++ perl/pod/perlsec.pod Fri Jun 27 01:54:16 2003
@@ -417,6 +417,19 @@
confuse some applications (like Data::Dumper: the outputs of two
different runs are no more identical).
+B<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 B<not> be used for
+applications like shuffling a list randomly (use List::Util::shuffle()
+for that, see L<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.
+
=item *
Regular expressions - Perl's regular expression engine is so called
End of Patch.