Use sub_name and stash_name from Sub::Identify instead of building up and breaking...
Shawn M Moore [Sun, 18 May 2008 14:40:07 +0000 (14:40 +0000)]
lib/Class/MOP/Method.pm

index d241582..314b5ee 100644 (file)
@@ -26,8 +26,8 @@ sub wrap {
         || confess "You must supply a CODE reference to bless, not (" . ($code || 'undef') . ")";
     bless { 
         '&!body' => $code,
-        '$!package_name' => $params{package_name} || (Class::MOP::get_code_info($code))[0],
-        '$!name' => $params{name} || (Class::MOP::get_code_info($code))[1],
+        '$!package_name' => $params{package_name} || Class::MOP::stash_name($code),
+        '$!name' => $params{name} || Class::MOP::sub_name($code),
     } => blessed($class) || $class;
 }