Syntactic Confectionery Delight | |
PerlMonks |
Re: Do you think it's kosher to "re-bless" a Moose object?by Anonymous Monk |
on Nov 17, 2011 at 14:43 UTC ( [id://938627]=note: print w/replies, xml ) | Need Help?? |
Channelling mst from #moose:
Better to apply a role to an instance, or if you really must change the class use ->meta->rebless_instance. But applying a role at runtime is generally better. And if you have the data early enough, $class->with_traits(...)->new using MooseX::Traits would be ideal.
In Section
Seekers of Perl Wisdom
|
|