in reply to Re: Re: OO - problem with inheritance
in thread OO - problem with inheritance
This should work if you want to register your parameters in base_class. BTW you don't need to override parameter_config at all in this case because SUPER->parameter_config returns hash reference stored in $parameter_config variable in base class. So next two lines do affect hash used by base_class. If it is not desired effect you should clone that hash:my $parameter_config = __PACKAGE__->SUPER::parameter_config; $parameter_config->{max_length}{max} = 255; $parameter_config->{max_length}{default} = 255; sub parameter_config { $parameter_config }
Update: Fixed usage of wrong syntax (SUPER->method instead of __PACKAGE__->SUPER::method)use Storable qw(dclone); my $parameter_config = dclone(__PACKAGE__->SUPER::parameter_config); $parameter_config->{max_length}{max} = 255; $parameter_config->{max_length}{default} = 255; sub parameter_config { $parameter_config }
--
Ilya Martynov
(http://martynov.org/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: OO - problem with inheritance
by uwevoelker (Pilgrim) on Jan 14, 2002 at 21:14 UTC | |
|
Re: Re: Re: Re: OO - problem with inheritance
by uwevoelker (Pilgrim) on Jan 16, 2002 at 23:27 UTC | |
by IlyaM (Parson) on Jan 17, 2002 at 16:50 UTC |