(Perl)在Mac OSX 10.6中,不能在Term :: ReadLine :: Gnu中执行`initialize'

时间:2010-11-08 18:34:52

标签: perl macports readline

我最近安装了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。有人有什么想法吗?

由于

4 个答案:

答案 0 :(得分:1)

我刚在Mac上遇到过这个问题。有趣的是,我尝试进入cpan交互式控制台也产生了同样的错误。

根据一些网页搜索,我然后运行了这个命令:     x == if("yahoo.com")

这解决了我的问题。然后,我可以使用cpan install Term::ReadLine::Gnu

进入cpan交互式控制台并运行perl调试器

答案 1 :(得分:0)

我的Macports版本的Perl从来没有运气好。我总是安装自己的。

您不会安装相同的模块,因为(例如),5.8,5.9和5.10不是二进制兼容。有问题的模块可能需要C编译器来构建。

是否有某些原因您不想构建和安装现代版本的Perl?

答案 2 :(得分:0)

我不知道这在OSX上是如何工作的,但我在linux上遇到了同样的问题。我通过安装libtermcap2(deb)或compat-libtermcap(rpm)来解决它。

I found the solution here

答案 3 :(得分:0)

我执行了

brew uninstall --ignore-dependencies term-readline-gnu-perl
brew install term-readline-gnu-perl

它奏效了。