Just another Perl shrine | |
PerlMonks |
Re: Generate unique ids of maximum lengthby jeffreyray (Sexton) |
on Apr 12, 2010 at 18:14 UTC ( [id://834334]=note: print w/replies, xml ) | Need Help?? |
I use String::Random when wanting to create randomly generated identifiers. I like the randregex method - which takes a regex and will generate a random string that will conform to the regex. This doesn't solve the problem you are - but I thought you/others may find it useful for solving this type of problem. It also doesn't verify that the id is unique among others, but that can be accomplished trivially using a hash with the identifiers as keys.
In Section
Seekers of Perl Wisdom
|
|