my %seen; for my $item (@array) { $seen{$item}++ # remember this item }; my @unique = keys %seen; # The order gets lost though