class Article { has 'title' => (is => 'rw', isa => 'Str'); has 'body' => (is => 'rw', isa => 'Str'); has 'keywords' => ( is => 'rw', isa => 'ArrayRef[Str]', lazy => 1, default => sub { [] }, ); use autobox::Core; method add_keyword (Str $keyword) { return if $keyword ~~ $self->keywords; # push @{ $self->keywords }, $keyword; $self->keywords->push($keyword); } }