Fix FAQ on require+attributes
[gitmo/Moose.git] / lib / Class / MOP / Module.pm
index 0dd274d..077cd38 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;
 }
@@ -110,6 +110,23 @@ B<Class::MOP::Module> is a subclass of L<Class::MOP::Package>.
 
 =over 4
 
+=item B<< Class::MOP::Module->create($package, %options) >>
+
+Overrides C<create> from L<Class::MOP::Package> to provide these additional
+options:
+
+=over 4
+
+=item C<version>
+
+A version number, to be installed in the C<$VERSION> package global variable.
+
+=item C<authority>
+
+An authority, to be installed in the C<$AUTHORITY> package global variable.
+
+=back
+
 =item B<< $metamodule->version >>
 
 This is a read-only attribute which returns the C<$VERSION> of the