in reply to quandery about a grep statement

If you want to remove duplicates from an array and sort them, the shortest way I can come up with uses a temporary hash:
my %hash; @hash{@values} = (); my @sorted_uniq = sort keys %hash;
That could be compacted further, but I'm lazy and I don't want to overwhelm people (yeah, that's it).

Depending on how well sorted @values is, this could be more expensive than a simple for loop without grep or map.