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 reply to Re: Using 'keys' on a list (updated)
by haukex
in thread Using 'keys' on a list
by lammey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |