Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
use Moops 0.029;
class Person 0.001
lexical_has name => (
isa => Str,
reader => \(my $_get_name),
writer => \(my $_set_name),
method assume_name (Str $name)
say "OK, that's my new name.";
method my $_introduction (Str $template = "Hello, I am %s.")
return sprintf($template, $self->$_get_name);
method introduce_yourself ()
say $self->$_introduction();
my $bob = Person->new;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment