my %hash; my @array = qw(1 3 4 55 4 3 4 22 1 3 4 3 2 2 3 34); foreach (@array){ $hash{$_}++; } #### 55,22,34 are the numbers that appear only once