Why not use something like Data::UUID? http://search.cpan.org/~rjbs/Data-UUID-1.148/UUID.pm
There is reads: "It provides reasonably efficient and reliable framework for generating UUIDs and supports fairly high allocation rates -- 10 million per second per machine -- and therefore is suitable for identifying both extremely short-lived and very persistent objects on a given system as well as across the network." I used this in a former project for unique persistent object ids. -- Ernesto