in reply to Inheritence of a Constructor that uses a file-scoped lexical?
So you can still use the %fields lexical and Some::Package's constructor. How's that?## in Some::Package sub _init_attribs { %$fields = %{+pop}; } ## in Some::Package::Sub my %fields = map { $_ => 1 } qw( field_a anotherone ); sub new { my $self = shift; $self->_init_attibs(\%fields); $self->SUPER::new(@_); }
_________
broquaint
update: changed code to DWOrsmoMeant
|
|---|