Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

•Re: Overloading inherited class methods

by merlyn (Sage)
on Dec 05, 2002 at 00:13 UTC ( #217634=note: print w/replies, xml ) Need Help??

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.

  • Comment on •Re: Overloading inherited class methods

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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://217634]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2021-01-23 14:07 GMT
Find Nodes?
    Voting Booth?