in reply to Re^2: Overriding methods and Inheritance
in thread Overriding methods and Inheritance

It might even be reasonable to expect "$self->SUPER" to do this.

Just to extend my example a little to include that, let's add another method to AngryDog:

sub pull_tail { $self->SUPER; bite(); }
In real-world logic, it's obvious that the AngryDog should still growl before biting when its tail is pulled, not bark.

It's been quite a while since I last used C++, but I talked to a Java junkie friend the last time something like this came up and he confirmed that Java handles it the same as Perl does. I'm pretty sure C++ (and, for that matter, any language that supports polymorphism) would also behave similarly. To do otherwise would render abstract classes/methods pointless. (Derived class overrides the abstract method, base class method calls the abstract method, and... either nothing happens or an exception is thrown unless it calls the derived class's version instead of the base version.)

But, yeah, I do agree that inheritance looks like an obvious candidate, but dragonchild's AUTOLOAD-based solution is surely both the slickest solution and the one which requires the least code to do what you want.