5.2. Fetching data from a hash

Example 5-2. examples/hash/print_hash.p6

#!/usr/bin/perl6

my %user = (
    "fname" => "Foo", 
    "lname" => "Bar",
    "email" => "foo@bar.com",
);

for keys %user -> $key {
    say "$key  %user{$key}";
}

say "----";

for %user.keys -> $key {
    say "$key  %user{$key}";
}