use strict; my @a= (1,2,3,4,5,6,6,5,4,3,2,1); my %help; map { $help{$_}=1} @a; @a = keys %help; print @a;