my %unique; foreach my $thingy (@array_with_duplicates) { $unique{$thingy} = 1; } my @array_without_duplicates = keys %unique;