From: Rafael Garcia-Suarez Date: Wed, 18 Jul 2007 10:26:31 +0000 (+0000) Subject: Clarifications on the hash seed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d4a1e6ca30520db246b5fce3fe5bd367590922f;p=p5sagit%2Fp5-mst-13.2.git Clarifications on the hash seed p4raw-id: //depot/perl@31624 --- diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 246d5b3..73850f3 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -1261,8 +1261,13 @@ X (Since Perl 5.8.1.) Used to randomise Perl's internal hash function. To emulate the pre-5.8.1 behaviour, set to an integer (zero means exactly the same order as 5.8.0). "Pre-5.8.1" means, among other -things, that hash keys will be ordered the same between different runs -of Perl. +things, that hash keys not always be ordered the same between different +runs of Perl. + +Most hashes return elements in the same order as Perl 5.8.0 by default. +On a hash by hash basis, if pathological data is detected during a hash +key insertion, then that hash will switch to an alternative random hash +seed. The default behaviour is to randomise unless the PERL_HASH_SEED is set. If Perl has been compiled with C<-DUSE_HASH_SEED_EXPLICIT>, the default @@ -1270,8 +1275,6 @@ behaviour is B to randomise unless the PERL_HASH_SEED is set. If PERL_HASH_SEED is unset or set to a non-numeric string, Perl uses the pseudorandom seed supplied by the operating system and libraries. -This means that each different run of Perl will have a different -ordering of the results of keys(), values(), and each(). B. Hashes are randomized to protect against local and remote attacks against Perl