# Basic class class Phone { has $.OS; # public, read-only attribute... has $.carrier; # ...automatic generation of accessor of same name method call { ... } } my $phone = Phone.new(OS => "Android", carrier => "AT&T"); say $phone.WHAT; # (Phone) say $phone.OS; # Android $phone.OS = "iOS" # Error: Can't write to a readonly attribute