> > > > All children. All forked. No srand. All different. > > I've seen this before - it might depend on loaded modules (e.g. a > module might call srand in the parent). I've applied the patch anyway > as it's sensible.
I just tested calling srand in the parent, and I still get different filenames. Here's why... In the version of File::Temp on my system, (which is the version that comes with 5.8.3) there is code that says (paraphrased): "If I coudln't successfully open the file, generate a new random filename." That's from the original import of File::Temp from CPAN, on 2000/05/07.. so if you don't have that, you're way out of sync. Here's the actual comment in the code, for searching purposes: 6080: # Did not successfully open the tempfile/dir 6080: # so try again with a different set of random letters 6080: # No point in trying to increment unless we have only 6080: # 1 X say and the randomness could come up with the same 6080: # file MAX_TRIES in a row. (6080 is the patch number for those lines.) Matt, I think we should revert the patch -- it doesn't serve the specified purpose. At the very least we need to fix the comment formatting and as JP noted, fix the algorithm. It has too many arbitrary parenthesis. -R
