Subject: | enc2xs -C fails if URL::Encode::XS is installed |
Running enc2xs -C fails on one of my systems:
$ /opt/perl-5.18.4/bin/enc2xs -C
require Encode;
...
require Encode::XS;
Can't require Encode::XS: Can't locate Encode/XS.pm in @INC (you may need to install the Encode::XS module) (@INC contains: /opt/perl-5.18.4/lib/site_perl/5.18.4/x86_64-linux /opt/perl-5.18.4/lib/site_perl/5.18.4 /opt/perl-5.18.4/lib/5.18.4/x86_64-linux /opt/perl-5.18.4/lib/5.18.4 .) at (eval 39) line 1.
There's no Encode::XS installed here, but instead it seems that URL::Encode::XS is wrongly recognized as Encode::XS.
A possible solution for make_configlocal_pm, as untested (!) pseudo code:
for $incdir (@INC) {
$encdir = File::Spec->catpath($incdir, 'Encode');
if (-d $encdir) {
find $wanted, $encdir;
}
}
And rewrite the path2mod conversion code in $wanted to just strip $incdir:
$mod = substr($File::Find::name, length($incdir)+1);
$mod =~ s{/}{::}g;
$mod =~ s{\.pmz}{};