package My::Object; use strict; use Object::Local; give_methods our $self; our $name : Prop; our $color : Prop; sub as_string : Method { return ref($self) . " named '$name' with color '$color'"; } 1; __ELSEWHERE__ use My::Object; my $o = My::Object->new; $o->set_name("xdg")->set_color("orange"); print $o->as_string; __RESULT__ My::Object: named 'xdg' with color 'orange'