in reply to random index in array - no duplicates

A quick way to get a list of unique values is to store them as keys in a hash.
my @ary = qw(a a b c d e f f f g h i i j k l l); my %unique = map { $_, 1 } @ary; my @randUnique = sort { rand(1) <=> rand(1) } keys %unique;