use strict; use warnings; use List::Util 'uniq'; use Test::More; my @input = (1,2,2,3,4,5,2,1); my @wanted = (1,2,3,4,5); my @got = uniq @input; is_deeply(\@got, \@wanted); done_testing; __END__