in reply to Perl : How to Create Unique String/Number?
my @alphabet = (('a'..'z'), 0..9); my %collection; for (1..30) { my $len = rand(11) + 10; my $key = join '', map {$alphabet[rand(@alphabet)]} 1..$len; $collection{$key} ? redo : $collection{$key}++; } print join "\n", keys %collection;
|
|---|