in reply to Re^5: Converting Moose object to a subclass of itself
in thread Converting Moose object to a subclass of itself
I would implore you to learn the base Perl way of generating objects in this case.
It appears to me as though you're losing out on a piece of the puzzle here. I do not mean to be disrespectful, but I think a peruse of perltoot and perlobj would really help.
Starting with something that wraps (ie. hides) the constructor (eg: Moose, Moo) may be hindering you from seeing what is truly possible.
An object can create an object of its own kind if designed properly, even with significantly different attributes and settings. You are not wanting to re-bless here, I assure you. You want to create either a same-object, or a sub-object depending on parameters sent in.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Converting Moose object to a subclass of itself
by nysus (Parson) on Feb 27, 2017 at 01:05 UTC | |
by stevieb (Canon) on Feb 27, 2017 at 01:19 UTC | |
by nysus (Parson) on Feb 27, 2017 at 01:39 UTC | |
by nysus (Parson) on Feb 27, 2017 at 01:36 UTC | |
by Anonymous Monk on Feb 27, 2017 at 19:02 UTC |