my @string = qw(a a a a b b b c d e f q q q r r r); my @singletons = uniq(@string);