my @str = qw(aaa bbb ccc ddd eee ddd aaa bbb ccc); my %uniq = (); my @uniq_str = grep { ! $uniq{$_}++ } @str;