Moose && utf8 names (package | method)

Having this:

use utf8; package ÁngryBird; #note the Á in the package name 

perl -c result of syntax OK .

 use utf8; package ÁngryMoose; use Moose; 

perl -c says

 ÁngryMoose is not a module name at /opt/local/lib/perl5/site_perl/5.12.4/darwin-multi-2level/Class/MOP/Package.pm line 209. 

So what is wrong with the code?

+4
source share
2 answers

Moose uses this regexp from Package::Stash::PP to check the package name:

 elsif ($package !~ /\A[0-9A-Z_a-z]+(?:::[0-9A-Z_a-z]+)*\z/) { confess "$package is not a module name"; } 

or is it a regular expression from Package::Stash::XS :

 const char *vmre = "\\A[0-9A-Z_a-z]+(?:::[0-9A-Z_a-z]+)*\\z"; 

But you can create your own package installation in the Package::Stash namespace and use it by setting the PACKAGE_STASH_IMPLEMENTATION environment PACKAGE_STASH_IMPLEMENTATION or the $Package::Stash::IMPLEMENTATION variable before loading Package::Stash . For example, if your implementation is named Package::Stash::My , then set the variable to My .

+8
source

It looks like it could be a Class::MOP error. Have you tried asking there or reporting an error?

+1
source

All Articles