{ package ClassA; ... sub new { ... my $self = bless({}, $class); $self->{...} = ...; return $self; } ... } { package ClassB; our @ISA = 'ClassA'; sub new { ... my $self = $class->SUPER::new(); $self->{...} = ...; return $self; } ... } { package ClassC; our @ISA = 'ClassB'; sub new { ... my $self = $class->SUPER::new(); $self->{...} = ...; return $self; } ... }
No infinite loops, though. Not in your version or mine.
In reply to Re: Inheritance - parent of parent
by ikegami
in thread Inheritance - parent of parent (solved)
by jockel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |