in reply to Why does ‘keys’ need a named hash?
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...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why does 'keys' need a named hash?
by dsheroh (Monsignor) on Apr 06, 2017 at 07:39 UTC | |
Re^2: Why does 'keys' need a named hash?
by Anonymous Monk on Apr 06, 2017 at 02:09 UTC | |
Re^2: Why does 'keys' need a named hash?
by vrk (Chaplain) on May 22, 2017 at 08:45 UTC |
In Section
Seekers of Perl Wisdom