no reason to not be using ::Package api here
Jesse Luehrs [Mon, 18 Apr 2011 02:07:05 +0000 (21:07 -0500)]
lib/Class/MOP/Module.pm

index 0dd274d..ea1433d 100644 (file)
@@ -77,10 +77,10 @@ sub _instantiate_module {
     Class::MOP::_is_valid_class_name($package_name)
         || confess "creation of $package_name failed: invalid package name";
 
-    no strict 'refs';
-    scalar %{ $package_name . '::' };    # touch the stash
-    ${ $package_name . '::VERSION' }   = $version   if defined $version;
-    ${ $package_name . '::AUTHORITY' } = $authority if defined $authority;
+    $self->add_package_symbol('$VERSION' => $version)
+        if defined $version;
+    $self->add_package_symbol('$AUTHORITY' => $authority)
+        if defined $authority;
 
     return;
 }