Background:
I whish to create a distribution that contains a few modules for personal use — it will never see the light of day (aka. CPAN). I would like to start these modules using Module::Starter to leverage easy testing, and version management.
(perl 5.12.4 on Ubuntu GNU/Linux)
Question:
How do I use Unicode filenames with Module::Starter, e.g. Local::Λ ← (Lambda)?
This doesn’t work:
$ module-starter --module Local::Λ
Invalid module name: Local::Λ at /usr/local/share/perl/5.12.4/Module/Starter/App.pm line 132.
The line that actually fails is
croak "Invalid module name: $_" unless /\A[a-z_]\w*(?:::[\w]+)*\Z/i;
in Module::Starter::Simple (line 95).
The Lambda clearly is a "word" character.
This works, by the way:
$ cat > xΛ.pm
use utf8;
package xΛ;
sub foo { print "42\n" }
1;
^D
$ perl -Mutf8 -MxΛ -e 'xΛ::foo()'
42
$
Things I have not yet tried:
- spending a day compiling perl 5.16 for more unicode goodness.
- hacking away at the source, and enabling anything remotely connected to unicode.
- Checking that this isn’t just a restriction on distribution names (which I am not concerned about, as CPAN will never see this).
- Checking if this could be a
Getopt::Longproblem.
The definition of ‘word character’ changes with: a) your version of perl. b) If the script in question is using your input as a binary string or a character string. Check out the
/a&/uflags of recent versions of perl’s regex engine.FYI: Because the Perl folks strive for cross-platform compatibility and there is widely varying support for Unicode in various filesystems, they’ve decided not to support Unicode Module Names at this time.
Resolution from Amon’s Comment:
this did the trick:
(Using
\x{...}escapes forces unicode, according to perlre).