You're looking for the bless operator/command/function/whatever it's called:
bless $change, 'NewObj';
The ability to change an object's class at runtime is pretty powerful and can be used for mock objets, for example. However, you should only do this if you are sure that the internal storage is compatible.
In reply to Re: Replacing objects
by dcmertens
in thread Replacing objects
by trizen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |