![]() |
|
"be consistent" | |
PerlMonks |
Re: Generating Repeatable Pseudorandom Sequencesby dws (Chancellor) |
on Sep 04, 2002 at 18:28 UTC ( #195154=note: print w/replies, xml ) | Need Help?? |
For use in a shuffling algorithm, I need to be able to generate repeatable pseudo random sequences ... this code runs under mod_perl, it is possible that later code will require a random number that is not so deterministically chosen
Sounds like you needs to find or implement a random number generator that keeps its state within in instance of a package. That way you can have several generators active without them affecting each other (or interfering with rand() et al.). A search on search.cpan.org for "random" turns up a number of hits, including one for Math::Random, which looks like it might suit your purposes.
In Section
Seekers of Perl Wisdom
|
|