給定訪問者的列表有以下幾種可能嗎?如果可能的話,我將如何爲每個創建構建器方法,我認爲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,
);
}
你爲什麼不試試? – Borodin