给定访问器列表是否可能?如果有可能我将如何为每个创建构建器方法,我假设lazy_build 属性会这样做?请帮忙
my @accessors= qw/type duration process/; # used 3 as example but the list is about 50
foreach my $accessors (@accessors) {
has $accessors => (
is => 'rw',
isa => 'Str',
lazy_build => 1,
);
}