in reply to Re: File::Temp randomness when forking
in thread File::Temp randomness when forking
Thanks for this! I did not know this is how things work, didn't bother looking through the source for more than a few minutes.
FWIW, I call tempdir first because I want all the forks to dump their files into the same dir so I can collect their output easily in the parent when they finish. (I would think this would be a common pattern, but maybe not.)
This is why I included slightly more source than you personally would prefer -- I wanted to show a bit of why I am doing this the way I am doing it. It is reduced considerably from the actual code (down to 26 lines not counting __DATA__ vs. 13 lines for yours). On further consideration, I would probably cut it down as you suggest, and deal with any "why did you do this" questions as they come up (instead of preempting them).
In any case, I doubt I would have stumbled on anything involving srand no matter how much I cut down my code, as it was never in my code! I only know about it because you pointed it out to me, so thanks.
RT
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: File::Temp randomness when forking
by tirwhan (Abbot) on Nov 29, 2005 at 17:57 UTC | |
by ryantate (Friar) on Nov 29, 2005 at 18:07 UTC |