in reply to •Re: Change the parent of an instance
in thread Change the parent of an instance
What's wrong with reblessing then?
The variable keeping track of the actual type might be a good idea, but many of the methods will then look like
Update: I have not yet thought about re-blessing. I think it's a good idea, worthwhile trying but if you say it's bad (or at least, will suck) I'll be glad to know why, just to find out if re-blessing is what I want.
because the two share a lot, although they hardly share anything.if ($somehow_is_a_foe) { } else { }
Update: I have not yet thought about re-blessing. I think it's a good idea, worthwhile trying but if you say it's bad (or at least, will suck) I'll be glad to know why, just to find out if re-blessing is what I want.
In Section
Seekers of Perl Wisdom