From: Chip Salzenberg Date: Wed, 19 Feb 1997 19:04:03 +0000 (+1200) Subject: Automatically call srand() before rand() if user didn't X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=93dc8474cb0353bd11e64192d213ed864602986f;p=p5sagit%2Fp5-mst-13.2.git Automatically call srand() before rand() if user didn't --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 9d21587..b3cf4e4 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2275,8 +2275,8 @@ If EXPR is omitted, uses $_. Returns a random fractional number between 0 and the value of EXPR. (EXPR should be positive.) If EXPR is omitted, returns a value between -0 and 1. This function produces repeatable sequences unless srand() -is invoked. See also srand(). +0 and 1. Automatically calls srand() unless srand() has already been +called. See also srand(). (Note: if your rand function consistently returns numbers that are too large or too small, then your version of Perl was probably compiled @@ -3036,17 +3036,23 @@ root of $_. =item srand EXPR -Sets the random number seed for the C operator. If EXPR is omitted, -uses a semi-random value based on the current time and process ID, among -other things. In versions of Perl prior to 5.004 the default seed was -just the current time(). This isn't a particularly good seed, so many -old programs supply their own seed value (often C