Syntactic Confectionery Delight | |
PerlMonks |
Re: Poor randomness with File::Temp and fork().by atcroft (Abbot) |
on Jun 27, 2004 at 17:00 UTC ( [id://369999]=note: print w/replies, xml ) | Need Help?? |
I am not sure this to be the case, but here is what I would suspect is going on. If you are calling srand() before forking (or not calling srand), then the children have the same random seed as they start, and thus will get the same sequence of pseudorandom numbers from rand(), which I suspect is being used to generate the random filename in File::Temp. I would also think possibly calling srand inside the forked child might be a way of getting around this issue. Hope that helps.
In Section
Seekers of Perl Wisdom
|
|