in reply to Re^2: Inheritance automation help
in thread Inheritance automation help
So the way I was saying it was backwards making my question confusing to what my actual goal was. I'm sure this is very "hand slapish" behavior and complicated when it comes to overridden methods... but that was the key to solving my dilemma. Thanks for the help and enlightenment Monks!#!/usr/bin/perl use strict; use warnings; package Top; sub new { my ($class, %params) = @_; my $self = bless \%params, $class; return $self; } sub firstSub { my ($class) = @_; print "FIRST SUB!\n"; } package Top::Extend1; push @Top::ISA, 'Top::Extend1'; sub addOnSub { my ($self) = @_; print "ADD ON\n"; } package Top::Extend2; push @Top::ISA, 'Top::Extend2'; sub secondAddOn { my ($self) = @_; print "SECOND ADD ON\n"; } package main; my $test = Top->new(); $test->firstSub(); $test->addOnSub(); $test->secondAddOn();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Inheritance automation help
by chromatic (Archbishop) on Apr 17, 2012 at 20:40 UTC |