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;
}