http://www.perlmonks.org?node_id=217634


in reply to Overloading inherited class methods

Besides the wonderful other advice you've gotten in this thread, let's look at why it broke, which I don't think has been said directly.

Your overriden "new" doesn't have the same protocol as the base class "new". (The overridden "new" takes an id, then a hash of parameters, but the base class "new" just takes a hash of parameters.) That's asking for trouble. If you have a different protocol, you can't override. You have to pick a new method name, or use Class::MultiMethods to let thedamian duke it out on your behalf.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: Re: Overloading inherited class methods
by feanor_269 (Beadle) on Dec 05, 2002 at 17:41 UTC
    Whoo!!! I was going to post on something like how to do what Class::MultiMethods does when I got stopped up on it. :)
    This sure makes things a lot easier.

    Feanor_269