my @allkeys = qw (hallo ciao hi hallo hello hi); my %seen; my @uniq = grep { !$seen{$_}++ } @allkeys; print "@uniq"; # Ausgabe: hallo ciao hi hello