Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: replace object methods at runtime

by karavelov (Monk)
on Jun 24, 2008 at 13:40 UTC ( [id://693736]=note: print w/replies, xml ) Need Help??


in reply to Re: replace object methods at runtime
in thread replace object methods at runtime

Thanks, sounds interesting this prototype objects. Quick view of the source reveals that in this manner can be defined new methods but I doubt that could be replaced already existing ones. The solution is to make some kind of dispatch table indexed by id of the object and method and than create subs in AUTOLOAD. But I really doubt that the new method could shadow the already existing method.
For now I think to just clean the double dispatch solution that I already have.
  • Comment on Re^2: replace object methods at runtime

Replies are listed 'Best First'.
Re^3: replace object methods at runtime
by friedo (Prior) on Jun 24, 2008 at 14:17 UTC
    If you don't need something as heavy-duty as Class::Prototyped, you can use Class::Unique, which gives every instance a unique subclass whose symbol table you can tweak at will.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-19 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found