Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Using 'keys' on a list (updated)by haukex (Archbishop) |
on Jun 29, 2021 at 17:13 UTC ( [id://11134456]=note: print w/replies, xml ) | Need Help?? |
You can use pairkeys from List::Util, i.e. say for pairkeys f; works fine. You'll need List::Util 1.29 for this function, which is part of the Perl core since 5.20, or you can get it from CPAN. Update: tybalt89 makes a good point that pairkeys may return duplicate "keys", unlike keys.
In Section
Seekers of Perl Wisdom
|
|