|Welcome to the Monastery
inheritance: constructorsby Basilides (Friar)
|on Jun 24, 2002 at 22:09 UTC
Basilides has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm having trouble using SUPER to call an ancestor's constructor. Say i've got an abstract class, Word, and a subclass, Noun, which derives from it, and calls it's parent's constructor, but then takes a few extra parameters. The only way I can get it to work is to create and bless my $self and then call SUPER:
This seems very clunky & makes me think it's hardly worth setting up the inheritance. But I know that in Java you can do it in one line, so I bet you can in Perl too? Can anyone suggest an optimised version of the above?