Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Why does 'keys' need a named hash?

by pme (Parson)
on Apr 05, 2017 at 12:12 UTC ( #1187098=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1187098]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2018-02-24 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (311 votes). Check out past polls.

    Notices?