Use Unicode filenames with module :: Starter

Reference Information:

I want to create a distribution that contains several modules for personal use - it will never see the light of day (aka CPAN). I would like to run these modules with Module::Starter

in order to use light testing and version control.

(perl 5.12.4 on Ubuntu GNU / Linux)

Question:

How to use Unicode filenames with the :: Starter module eg. Local::Λ

← (Lambda)?

This does not 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 doesn't actually work

croak "Invalid module name: $_" unless /\A[a-z_]\w*(?:::[\w]+)*\Z/i;

      

in Module::Starter::Simple

(line 95).

Lambda is clearly a word symbol.

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 haven't tried yet:

  • spend a day compiling perl 5.16 to get more unicodes.
  • hack the source code and enable all remote unicode connection.
  • Checking that this is not just a restriction on distro names (which doesn't bother me as CPAN will never see this).
  • Checking if this might be the problem Getopt::Long

    .
+3


source to share


1 answer


The definition of "word character" is changed by: a) your version of perl. b) If the script in question is using your input as a binary string or character string. Check out the flags /a

and /u

latest versions of the relx perl engine.

FYI: Because the Perl people are striving for cross-platform compatibility, and Unicode support is widely used across file systems, they decided not to support Unicode Module Names at this time.




Permission from Amon's Comment: This did the trick:

perl -Mutf8 -M5.012 -MModule::Starter::App -E'$ARGV[1]="Local::\x{039B}";Module::Starter::App->run' -- --module Local::Λ --license gpl3 --ignore git

      

(Using \x{...}

unicode force escape, according to perlre ).

+3


source







All Articles