Constructor with inheritance
#---------------------------------------
package Parent;
1;
sub new {
my $class = shift;
my $self = {};
_initialise($self,@_);
return $self;
}
sub _initialise {
my $self = shift;
print "Parent._initiliase(@_)\n";
}
#---------------------------------------
package Child;
1;
use base qw(Parent);
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
_initialise($self,@_);
return $self;
}
sub _initialise {
my $self = shift;
print "Child._initiliase(@_)\n";
}
|