use v6; class Interesting { has $.name; method myNameIs ($name) { die "Don't tell me that I don't have a name." unless defined $name; $.name = $name; } method whoAmI () { return $.name; } } my $one = Interesting.new; $one.myNameIs('What'); my $two = Interesting.new; $two.myNameIs('Who'); my $three = Interesting.new(:name('tukatukatuka SlimShady')); say "My name is : " ~ $_.whoAmI() for ($one, $two,$three);