in reply to How to find and remove duplicate elements from an array?

use Array::Utils::unique:
use strict; use Array::Utils qw(:all); my @array = qw( a b c d c d e f g g g g g f); my @unique_array = unique(@array); print "@unique_array\n"; __END__ prints: e c a g b d f
In fact, the code for sub unique is a one liner; you could just hork and use it verbatim:
@unique_array = keys %{{map { $_ => undef } @array }};
There's also the (arguably more standard) List::MoreUtils::uniq.

Its code is nearly a one-liner. Copying it would look like this:

my %seen; @unique_array = grep { not $seen{$_}++ } @array;