# Straight forward way (sort keys slows down the larger the list) my %hash = map { $_ => 1 } @items; my @uniq = sort keys %hash; # Using List::MoreUtils::uniq() use List::MoreUtils qw(uniq); my @uniq = uniq(@items); # This is the method under the hood in List::MoreUtils::uniq my %h; my @uniq = map { $h{$_}++ == 0 ? $_ : () } @items;