Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Replacing objects

by sundialsvc4 (Abbot)
on Dec 19, 2013 at 00:39 UTC ( #1067752=note: print w/replies, xml ) Need Help??

in reply to Replacing objects

The superficial answer, to your immediate question, is (of course) “yes.”

By that I mean:   the bless() primitive (simply...) associates a particular class/object definition with a particular object-instance, such that the runtime interpreter, when presented with a “method-call,” will use that particular association in its effort to resolve the call.   Therefore, “yes... it is technically possible to, on-the-fly, change that association, just by calling bless() again.”

But, now, the “XY Problem” Question ...   What, exactly, are you trying to accomplish here?   (Hey, haven’t we a-l-l been in this very spot?)   A thing that “technically speaking, the interpreter ‘allows” you to do,” might or might not be the best ‘There’s More Than One Way To™’ way to do it, but “by now, we’re just too damm close to it.”   Therefore, please tell us more about your ultimate goal, so that The Peanut Gallery might assist you in assessing whether the Tree that you are currently barking up, really is the right Tree.   Perhaps there is another, better, “way to do it.”   :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067752]
erix likes the term condescension detection

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2018-05-24 14:38 GMT
Find Nodes?
    Voting Booth?