#!/usr/bin/perl6 use v6; =begin pod Perl 6 has built in support for creating hashes with predefined (immutable) keys. The following code shows how they B work. They are not yet implemented in Rakudo. =end pod my %person{}; %person = ( fname => 'Foo', lname => 'Bar', ); say %person{'fname'} ?? "fname exists" !! "fname is missing"; # should this give an exception? say %person{'email'} ?? "email exists" !! "email is missing"; # this should for sure %person{'email'} = 'foo@bar.com';