程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> Perl CPAN::Modulelist的解決辦法

Perl CPAN::Modulelist的解決辦法

編輯:關於PHP編程

今天用CPAN安裝Term::ReadLine,報了個這樣的錯誤

Going to read /root/.cpan/sources/modules/03modlist.data.gz
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 31) line 1.
at /usr/lib/perl5/5.8.5/CPAN.pm line 3406
CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/lib/perl5/5.8.5/CPAN.pm line 3129
CPAN::Index::reload('CPAN::Index') called at /usr/lib/perl5/5.8.5/CPAN.pm line 675
CPAN::exists('CPAN=HASH(0x9c79658)', 'CPAN::Module', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 1842
CPAN::Shell::expandany('CPAN::Shell', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 2078
CPAN::Shell::rematein('CPAN::Shell', 'install', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 2165
CPAN::Shell::install('CPAN::Shell', 'Term::ReadLine') called at /usr/lib/perl5/5.8.5/CPAN.pm line 201 eval {...} called at /usr/lib/perl5/5.8.5/CPAN.pm line 201 CPAN::shell() called at -e line 1

google結果有人是這樣解決的

rm -rf ~/.cpan
刪除後在perl -MCPAN -e shell中執行reload index
然後執行install Bundle::CPAN
最後執行reload CPAN即可正常通過命令行install MODULES

我按照這個做,結果reload index執行都報錯,繼續google,發現應該是Config.pm的問題,重新配置

cpan> o conf urllist unshift http://www.perl.com/CPAN/
cpan> o conf commit

然後再執行上面的reload index之後的步驟就OK了。

 


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved