http://www.perlmonks.org?node_id=1187098


in reply to Why does ‘keys’ need a named hash?

Hi ankitpati,

map { $_ => 1 } @_
returns list having even number of elements. 'keys' works only on hashes. In your working example %hash is initialized with the list returned by 'map' and then 'keys' can do the job on %hash.

HTH