I am just trying to run a simple perl program to import data from xml and export it to database.
Use Mysql; did not work, so I used DBD::mysql instead after failing to get Mysql.pm from cpan.
However, I am unable to install anything. I am trying to install xml parser module, but cpan gives these errors no matter what module you try to install.
install xml::parser CPAN: Storable loaded ok (v2.20) Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz' CPAN: Compress::Zlib loaded ok (v2.02) ............................................................................DONE Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz' Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen. CPAN: Time::HiRes loaded ok (v1.9719) Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen. DONE Going to read '/root/.cpan/sources/modules/03modlist.data.gz' Catching error: "Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 29) line 1.cJ at /usr/share/perl/5.10/CPAN/Index.pm line 518cJcICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl/5.10/CPAN/Index.pm line 85cJcICPAN::Index::reload('CPAN::Index') called at /usr/share/perl/5.10/CPAN.pm line 955cJcICPAN::exists('CPAN=HASH(0xa225610)', 'CPAN::Module', 'xml::parser') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1243cJcICPAN::Shell::expandany('CPAN::Shell', 'xml::parser') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1639cJcICPAN::Shell::rematein('CPAN::Shell', 'install', 'xml::parser') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1935cJcICPAN::Shell::__ANON__('CPAN::Shell', 'xml::parser') called at /usr/share/perl/5.10/CPAN.pm line 375cJcIeval {...} called at /usr/share/perl/5.10/CPAN.pm line 372cJcICPAN::shell() called at /usr/bin/cpan line 198cJ" at /usr/share/perl/5.10/CPAN.pm line 391 CPAN::shell() called at /usr/bin/cpan line 198 Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz' ............................................................................DONE Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz' Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen. Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen. cpanDONE Going to read '/root/.cpan/sources/modules/03modlist.data.gz' No history written (no histfile specified). Lockfile removed. Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 31) line 1. at /usr/share/perl/5.10/CPAN/Index.pm line 518 CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl/5.10/CPAN/Index.pm line 85 CPAN::Index::reload('CPAN::Index') called at /usr/share/perl/5.10/CPAN.pm line 692 CPAN::all_objects('CPAN=HASH(0xa225610)', 'CPAN::Distribution') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1046 CPAN::Shell::failed('CPAN::Shell', 2, 1) called at /usr/share/perl/5.10/CPAN.pm line 413 eval {...} called at /usr/share/perl/5.10/CPAN.pm line 413 CPAN::shell() called at /usr/bin/cpan line 198
Am I doing something wrong? I tried searching for these errors, but no one has a right solution. Is there some setting in the config I should change?
Advertisement
Answer
If nobody has an answer for your particular problem I would probably just try with a new cpan, something like:
cd && mv .cpan .cpan-bak
and then trying to install the module again.
Hope this helps.