in reply to srand producing the same sequence of random numbers
Well, as stated by another responder, that's one of the uses of srand() - from the perldoc -f srand output:
You can call srand($seed) with the same $seed to reproduce the same sequence from rand(), but this is usually reserved for generating predictable results for testing or debugging. Otherwise, don't call srand() more than once in your program.
Since srand is implicitly called on the first rand() call, there is no need to even call srand. Unless you need to :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: srand producing the same sequence of random numbers
by locked_user sundialsvc4 (Abbot) on Oct 12, 2010 at 14:05 UTC | |
|
Re^2: srand producing the same sequence of random numbers
by locked_user sundialsvc4 (Abbot) on Oct 12, 2010 at 14:05 UTC |