in reply to maintaining constructor inheritance cascade
Or, am I missing something?package myParent; our @ISA; sub new { my $class = shift; bless $self,$class; $self->_init(@_); return $self; } sub _init { my $self = shift; print "_initParent (@_)\n"; } #---------------------------------- package myChild; our @ISA; use base qw(myParent); # This function is completely unnecessary #sub new { # my $class = shift; # my $self = $class->SUPER::new; # $self->_init(@_); # return $self; #} sub _init { my $self = shift; print "_initChild (@_)\n"; }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: maintaining constructor inheritance cascade
by jaa (Friar) on May 14, 2003 at 14:35 UTC | |
by dragonchild (Archbishop) on May 14, 2003 at 15:09 UTC | |
by tilly (Archbishop) on May 14, 2003 at 15:30 UTC | |
by jaa (Friar) on May 14, 2003 at 15:31 UTC | |
by chip (Curate) on May 14, 2003 at 16:08 UTC |