class Dot { has $.x; has $.y; has $!z; # Fancy syntax which simply sets each private variable. submethod BUILD(:$!x, :$!y, :$!z) { say "Initializing!"; } method get { return ($!x, $!y, $!z); } }; my $a = Dot.new(x => 23, y => 42, z => 2); say $_ for $a.get;