Forum Moderators: coopster & phranque
foreach $i (@array) { push @new_array, $i unless $tmp{$i}++; }
For fun, I also tried this:
foreach $i (@array) { $tmp.="$i " unless $tmp=~/$i/; } @new_array=split(" ",$tmp);
...but it's waaay slower.