in reply to Inheritance - parent of parent (solved)
{ 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inheritance - parent of parent
by jockel (Beadle) on Nov 23, 2007 at 08:08 UTC | |
by ikegami (Patriarch) on Nov 23, 2007 at 08:33 UTC |