@array = sort { $a cmp $b } @array; # Now remove dups. %saw = (); @de_duped_array = grep (!$saw{$_}++, @array);