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


in reply to Generate a unique ID

I'm thinking to combine: process id with current date-time to the highest resoltion available.

That was my first idea too. Then I remembered that the Linux kernel has experimental support for PID namespaces, which means that it's possible to have arbitrary PIDs per user, and the same PID in two programs that are run by different users at the same time.

If you don't care about such exotic cases, you should be fine.