我最近安装了 MacPorts,我认为它可能弄乱了我的某些库。现在,当我尝试运行 Perl 调试器时,我得到了以下信息:
>perl -d -e 0
Cannot do `initialize' in Term::ReadLine::Gnu at /opt/local/lib/perl5/5.8.9/perl5db.pl line 6006
at /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Term/ReadLine/Gnu.pm line 716
Term::ReadLine::Gnu::AU::AUTOLOAD('Term::ReadLine=HASH(0x8f8b94)') called at /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Term/ReadLine/Gnu.pm line 240
Term::ReadLine::Gnu::new('Term::ReadLine', 'perldb', 'GLOB(0x85c690)', 'GLOB(0x855750)') called at /opt/local/lib/perl5/5.8.9/perl5db.pl line 6006
DB::setterm called at /opt/local/lib/perl5/5.8.9/perl5db.pl line 2235
DB::DB called at -e line 1
Cannot do `initialize' in Term::ReadLine::Gnu at /opt/local/lib/perl5/5.8.9/perl5db.pl line 6006
END failed--call queue aborted at -e line 44.
at -e line 44
Config::DESTROY(/opt/local/lib/perl5/5.8.9/darwin-2level/Config.pm:63):
63: sub DESTROY { }
IO::Handle::DESTROY(/opt/local/lib/perl5/5.8.9/darwin-2level/IO/Handle.pm:330):
330: sub DESTROY {}
我正在使用 readline 6.1。有人有什么想法吗?
谢谢
答案1
对于 Mac,您需要从 CPAN 安装 Perl 的 Term::ReadLine::Gnu 模块:
例如:cpanm Term::ReadLine::Gnu
这为我解决了这个问题。
鲍勃
答案2
我执行了
brew uninstall --ignore-dependencies term-readline-gnu-perl
brew install term-readline-gnu-perl
并且它成功了。