in reply to Why does ‘keys’ need a named hash?
use strict; use warnings; my @Uniq = uniq('a', 'b', 'c', 'a', 'b', 'a'); print "@Uniq\n"; sub uniq { return keys %{{map {$_=>1} @_}}; } OUTPUT: c a b
Edit: Revised example to be more like the original problem.
|
|---|