1/21 What is a good random seed function using time and $$ in Perl?
\_ One use might be to create filenames for temporary files. --dim
\_ a silly first try might be
my $filename = $$. time;
\_ No you stupid! I want to use srand() with a good seed. SHEESH.
\_ As of perl 5.004, you don't have to call srand at all; see
"perldoc -f srand" for details. If you want a better random
number generator, look at Math::TrulyRandom or /dev/random.
\_ hahahah. maybe you should rtfm, state your problem more
clearly, and see Math::TrulyRandom on CPAN, Einstein.
\_ srand(time % $$);
\_ (time % $$) does not generate good random numbers. |