While a random string _may_ be unique there's nothing that really guarantees(sp?) that it will be. UUID's however are. There is a perl module Data::UUID that will generate these things for you.
I have not used the module but I have used uuid's in the past for unique identifiers.
man uuidgen may give you more info.
Comment on Re: Perl : How to Create Unique String/Number?