My suggestion would be to use the time function from Time::HiRes.
That should give you a unique time (to the microsecond if your platform supports it), and should be okay until something like 2038?use Time::HiRes qw[time]; printf "%.6f\n", time for 1..10; 1054051486.970288 1054051486.980302 1054051486.990316 1054051487.000331 1054051487.010345 1054051487.010345 1054051487.020360 1054051487.030374 1054051487.040388 1054051487.050403
Update:
The timestamp is only a starting point.
If you are creating your temp files on shared media (suggestion:Don't!), or if you are running on a multi-processor machine, then you would need to combine the timestamps with additional information to aceive uniqueness. Processor ID in the latter case would work.
In the former case, which I would advise against, but if you have access to the hardcoded MAC addresses, this is a good starting point.
A bonus is that the resultant filenames are easily compared so cleaning up the directory periodically should be trivial.
In reply to Re: Automatically creating incremental file names
by BrowserUk
in thread Automatically creating incremental file names
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |