継承

extendsを使う。

User.pm

 package User;
 use Mouse;
 use URI;
 
 has 'name' => ( is => 'rw', isa => 'Str' );
 has 'age'  => ( is => 'rw', isa => 'Int' );
 has 'uri'  => ( is => 'rw', isa => 'URI' );
 
 __PACKAGE__->meta->make_immutable();
 1;

User/Man.pm

 package User::Man;
 use Mouse;
 extends 'User';
 
 has 'sex'  => ( is => 'rw', isa => 'Str' );
 
 __PACKAGE__->meta->make_immutable();

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS