http://qs1969.pair.com?node_id=11134437


in reply to Using 'keys' on a list

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:

my %h = f(); say for keys %h;

You can also just return every second element of the list:

my $i; say for grep ++$i % 2, f();

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]