use strict; # This should do ALL the _initXXX()s # even though myGrandChild does not know # about _initParent() or _initChild()! my $it = myGrandChild->new('a','b','c'); #---------------------------------- package myParent; our @ISA; sub new { my $class = shift; my $self = $ISA[0] ? $ISA[0]->new(@_) : {}; bless $self,$class; $self->_initParent(@_); return $self; } sub _initParent { my $self = shift; print "_initParent @_ [ISA: @ISA]\n"; } #---------------------------------- package myChild; our @ISA; use base qw(myParent); sub new { my $class = shift; my $self = $ISA[0] ? $ISA[0]->new(@_) : {}; bless $self,$class; $self->_initChild(@_); return $self; } sub _initChild { my $self = shift; print "_initChild @_ [ISA: @ISA]\n"; } #---------------------------------- package myGrandChild; our @ISA; use base qw(myChild); sub new { my $class = shift; my $self = $ISA[0] ? $ISA[0]->new(@_) : {}; bless $self,$class; $self->_initGrandChild(@_); return $self; } sub _initGrandChild { my $self = shift; print "_initGrandChild @_ [ISA: @ISA]\n"; } #----------------------------------