http://www.perlmonks.org?node_id=336439


in reply to Re: Is it possible to generate unique temporary filenames using hostname/process id?
in thread Is it possible to generate unique temporary filenames using hostname/process id?

Ok, I know I run the risk of looking like a dumbass here but (assuming a Unix platform) what's wrong with $$ . time()? Is the risk that so many processes are created within one second that the PIDs roll over?
  • Comment on Re: Re: Is it possible to generate unique temporary filenames using hostname/process id?
  • Download Code

Replies are listed 'Best First'.
Re: Is it possible to generate unique temporary filenames using hostname/process id?
by bill_mcgonigle (Acolyte) on Mar 15, 2004 at 02:34 UTC
    Stick a long random number on the end and your odds are pretty good. Of course, there's no reason not to look for a name collision to guarantee it.