utf8::all 在 perl-5.12.3 上不起作用,我无法卸载它

utf8::all on perl-5.12.3 doesn't work and I can't uninstall it

在安装了perl-5.12.3的MacOSX 10.7.5上,我需要使用utf8::all模块,所以我手动安装了utf8-all-0.024 (Note the minimum perl version of v5.10.0 on its CPAN page) The make test has failed but I've still installed it to see if it would work. It didn't work so I've decided to uninstall it. I've tried 2 methods given at perl.com 第一种方法没有按要求工作 perl-5.14.2 第二种方法给出了这条消息:

! utf-8 is not found in the following directories and can't be uninstalled.

  /Library/Perl/5.12/darwin-thread-multi-2level
  /Library/Perl/5.12

而且它也无法卸载它。如何卸载utf8-all-0.024?

此外,我有一个列出所有 Perl 模块的小脚本。它是:

use ExtUtils::Installed;
my $inst = ExtUtils::Installed->new();
my @modules = $inst->modules();
foreach $module (@modules) {
    print $module . "\n";
}

此脚本开始花费 CPU 的一分半钟来列出模块。在我搞砸系统之前,它给出了立竿见影的效果。如何纠正?

为了完整起见,@INCperl -V

给出
  @INC:
    /Library/Perl/5.12/darwin-thread-multi-2level
    /Library/Perl/5.12
    /Network/Library/Perl/5.12/darwin-thread-multi-2level
    /Network/Library/Perl/5.12
    /Library/Perl/Updates/5.12.3/darwin-thread-multi-2level
    /Library/Perl/Updates/5.12.3
    /System/Library/Perl/5.12/darwin-thread-multi-2level
    /System/Library/Perl/5.12
    /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.12
    .

更多信息:

perl -Mutf8::all -e 'print $INC{"utf8/all.pm"}, "\n"' 给出:

Can't locate Import/Into.pm in @INC (@INC contains: /Library
/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network
/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library
/Perl/5.12 /Library/Perl/Updates/5.12.3/darwin-thread-multi-2level
 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-
thread-multi-2level /System/Library/Perl/5.12 /System/Library
/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library
/Perl/Extras/5.12 .) at /Library/Perl/5.12/utf8/all.pm line 140.
BEGIN failed--compilation aborted at /Library/Perl/5.12/utf8/all.pm line 140.
Compilation failed in require.
BEGIN failed--compilation aborted.

你错误地安装了模块,把事情搞得一团糟。具体来说,你没有安装依赖项。

理想情况下,您应该使用 perl 本身提供的包管理器。但他们不提供每个模块。所以你会使用非包管理器方法:

cpan utf8::all

(我更喜欢使用 perlbrew 安装我自己的 perl,然后我可以放心地使用 cpan。)

现在,cpan 可能会声称 utf8::all 已经安装。如果是这样,这应该会让你理顺:

cpan -t utf8::all
cpan -f utf8::all   # Only if the previous command says everything is ok!