Chapter 5. Perl6 Hashes

5.1. Associative Arrays (Hashes)

A hash (also called associative array) is a set of key,value pairs
where the keys are unique strings and the values can have any, err value.

Hashes always start with a % (percentage) sign.

Example 5-1. examples/hash/create_hash.p6

#!/usr/bin/perl6

my %user_a = ("fname", "Foo", "lname", "Bar");

my %user_b = (
    "fname" => "Foo", 
    "lname" => "Bar",
);

say %user_a{"fname"};
%user_a{"email"} = "foo@bar.com";
say %user_a{"email"};

say %user_b<lname>;