#!/usr/bin/perl6 use v6; =begin pod One can use the C method of a hash to get all the keys. =end pod my %person = ( fname => 'Foo', lname => 'Bar', ); for %person.keys -> $k { say "$k {%person{$k}}"; } say "---"; =begin pod One can also use the C method to iterate over the key-value pairs of a hash. =end pod for %person.kv -> $k, $v { say "$k $v"; }