Best practices建议namespace::autoclean
和make_immutable
package Person;
use Moose;
use namespace::autoclean;
# extends, roles, attributes, etc.
# methods
__PACKAGE__->meta->make_immutable;
1;
MooseX::Declare
会自动处理此问题但不推荐使用
应该推荐什么替代品呢?
答案 0 :(得分:2)
MooseX::Declare documentation says:
如果你想在新代码中使用声明性语法,请为爱 小猫最近得到了一个perl,而是看Moops。