Classes and objects
Perl 6 has formal support for classes, objects, and roles:
class Dog is Mammal does Pet { has $.name = "fido"; # public read-only accessor has $.tail is rw; # public read-write accessor has @.legs; # public read-only array accessor has $!brain; # private scalar method bark() { say "w00f"; } } my Dog $fido .= new; $fido.feed('bone'); say $fido.name;