{ package a; use Moo; has avalue => (is => 'rw'); } my $obj = "a"->new(); $obj->avalue(10); # set print $obj->avalue, "\n"; # get