"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is an excellent solution. File::Temp detects and avoids collisions. It has a limited number of re-tries, so it also helps to use a template with a long enough wildcard segment that a collision is as likely as the earth's destruction by asteroid this month. File::Temp practices RAII safety by putting the clean-up code in its destructor so that even if the program terminates through an exception the destructor will remove the temp file. Parallel processing can wreck havoc on safe resource acquisition, but File::Temp has you covered (though you should read the POD section on forking). Security, community refinement, active maintenance, and extensive testing are all attributes that contribute to making this a good choice. Dave In reply to Re^2: unique file ID
by davido
|
|