Use blessed instead of ref to get an instance's class name
Shawn M Moore [Tue, 24 Mar 2009 03:11:42 +0000 (23:11 -0400)]
lib/Class/MOP/Class.pm

index 7a6f039..4b0112a 100644 (file)
@@ -411,7 +411,7 @@ sub rebless_instance {
         $old_metaclass = $instance->meta;
     }
     else {
-        $old_metaclass = $self->initialize(ref($instance));
+        $old_metaclass = $self->initialize(blessed($instance));
     }
 
     my $meta_instance = $self->get_meta_instance();