Welcome to the Monastery | |
PerlMonks |
Re: Why does 'keys' need a named hash?by vrk (Chaplain) |
on Apr 05, 2017 at 14:02 UTC ( [id://1187120]=note: print w/replies, xml ) | Need Help?? |
Actually, if you squint, you would indeed expect keys to return all elements with even index in a list. Similarly, values on a list should return all odd elements. That's how you make a hash: even elements become keys, odd elements become values. I can think of a couple uses cases for this DWIM behaviour that don't involve hashes...
In Section
Seekers of Perl Wisdom
|
|