I have a Moose class with some properties (x
,y
,z
). I subclass it, and for the subclass, x
is always 3. How can I specify this in subclass?
One could use BUILDARGS
.
around BUILDARGS => sub {
my $orig = shift;
my $class = shift;
return $class->$orig(@_, x => 3 );
};