|P is for Practical|
Re: Poor randomness with File::Temp and fork().by BazB (Priest)
|on Jun 27, 2004 at 19:39 UTC||Need Help??|
Thanks for all the replies.
I must admit, I had overlooked using the template or suffix options that File::Temp offers by default.
I do have calls to rand in other parts of the code (and calls to File::Temp prior to the fork()s), but I was just a little surprised that exactly the same sequences were occurring across so many processes.
Do not call srand multiple times in your program unless you know exactly what you're doing and why you're doing it....and I wasn't completely sure what I was doing :-)
The docs with 5.8.x aren't quite so stern.
If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.