$a_ref_to_the_object = Class->new; #### %$a_ref_to_the_object = %{Class->new}; #### sub retarget_ref { my ($old, $new) = @_; ref $old and ref $new or return; local $SIG{__DIE__}; # disable any user error handlers eval { $$old = $$new }; $@ or return; eval { @$old = @$new }; $@ or return; eval { %$old = %$new }; }