インスタンス生成時処理User.pmpackage User; use Mouse; has 'name' => (is => 'rw', isa => 'Str'); sub BUILD { my ( $self, $args ) = @_; say "DEBUG: " . $self->name; } __PACKAGE__->meta->make_immutable(); 1; main.plmy $user = User->new( name => 'taro' ); 説明
|
|
インスタンス生成時処理User.pmpackage User; use Mouse; has 'name' => (is => 'rw', isa => 'Str'); sub BUILD { my ( $self, $args ) = @_; say "DEBUG: " . $self->name; } __PACKAGE__->meta->make_immutable(); 1; main.plmy $user = User->new( name => 'taro' ); 説明
|
|