in reply to Unique filenames with Time::HiRes

You could set up another process as a filename-server which independently keeps count and spits out a new filename whenever asked. This filename could then consist of the datestamp plus a counter for any names with identical datestamps as previously mentioned.

Pros: Fast. No locking required.
Cons: You will probably have to write additional code to restart the server if it doesn't answer within a certain amount of time etc.