in reply to Why does ‘keys’ need a named hash?
It needs a real hash to work on (possibly there is a more technical description of this), but the map just produces a list of values, not a hash.
You can do it all in one line though:
use 5.010; sub uniq { return keys %{ {map { $_ => 1 } @_} }; } say for uniq qw/ foo bar foo baz bip foo /;
Good Day,
Dean
|
---|
In Section
Seekers of Perl Wisdom