Supposing I have a dog
my $dog = DOG->new; Then later I decide my dog is in fact a labrador. I could do bless $dog, 'LABRADOR';which (i think) would be fine as LABRADOR inherits from DOG
but Moose has things like
has color => (is => 'rw', isa => 'Str', default => 'golden')If I simply bless my $dog into LABRADOR then he won't be golden. How can I resolve this situation?
(I guess what I'm really asking is - is there a way to change the class of an object that already exists under Moose? Or perhaps this is not the done thing?)
In reply to changing moose object classes on the go by tomgracey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |