"be consistent" | |
PerlMonks |
Re^2: Poor randomness with File::Temp and fork().by Joost (Canon) |
on Jun 27, 2004 at 17:14 UTC ( [id://370004]=note: print w/replies, xml ) | Need Help?? |
If you are calling srand() before forking (or not calling srand) then the children have the same random seed as they startActually, if you don't call srand at all, the children will have different seeds as long as you don't call rand() before the fork() either (since perl 5.004). See perldoc -f srand: If srand() is not called explicitly, it is called implicitly at the first use of the "rand" operator.In this case, it's probably safest to call srand after the fork() anyway.
In Section
Seekers of Perl Wisdom
|
|