in reply to Return reference to hash keys

miketosh,
There is a module that does this for you (List::MoreUtils). It is also a FAQ. The fact that you want a reference back is an implementation detail. If I were doing it and since order doesn't seem to matter, I would probably do something like:
sub uniq { my %uniq; @uniq{map @$_, @_} = (); return [ keys %uniq ]; }

Update: This code is untested. I modified it to account for passing in array refs instead of arrays.

Cheers - L~R