.PPTF
ϦϦʔε
ຊ֨తͳΦϒδΣΫτγεςϜ͕ੜ
3BLV ࣌1FSM
ͷΞΠσΞΛഈआ
.01ίϯηϓτ
package User;
use Moose;
has 'name' => (is => 'rw', isa => 'Str');
has 'email' => (is => 'rw', isa => 'Str');
sub greet {
my $self = shift;
return "hello, ".
$
self->name;
}
# ͜͏͍͏;͏ʹ͑Δ
my $user = User->ne
w
({
name => 'john',
email => '
[email protected]',
});
say $user->name; # john
$user->name('doe');
say $user->name; # doe
say $user->greet; # hello, doe