![]() |
|
Just another Perl shrine | |
PerlMonks |
Re: Using 'keys' on a listby choroba (Archbishop) |
on Jun 29, 2021 at 12:41 UTC ( #11134437=note: print w/replies, xml ) | Need Help?? |
keys doesn't operate on a list, it operates on a hash (or an array since 5.12). You can create a hash, populate it with the list, and get its keys:
You can also just return every second element of the list:
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|