vendion has asked for the wisdom of the Perl Monks concerning the following question:

I know know if this is the right place to ask about CPAN problems, but lately I have been having problems doing anything with my CPAN module. No matter what I try it prints out this error:
Warning: Your /private/var/root/Library/Application Support/.cpan/sour +ces/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
After a while CPAN just crashes with the following error:
Going to read '/private/var/root/Library/Application Support/.cpan/sou +rces/modules/03modlist.data.gz' gzip: /private/var/root/Library/Application.gz: No such file or direct +ory gzip: Support/.cpan/sources/modules/03modlist.data.gz: No such file or + directory Terminal does not support GetHistory. Lockfile removed. Can't locate object method "data" via package "CPAN::Modulelist" (perh +aps you forgot to load "CPAN::Modulelist"?) at (eval 90) line 1. at /opt/local/lib/perl5/5.8.9/CPAN/Index.pm line 518 CPAN::Index::rd_modlist('CPAN::Index', '/private/var/root/Libr +ary/Application Support/.cpan/sources/m...') called at /opt/local/li + CPAN::Index::reload('CPAN::Index') called at /opt/local/lib/pe +rl5/5.8.9/CPAN.pm line 692 CPAN::all_objects('CPAN=HASH(0x9b3d74)', 'CPAN::Distribution') + called at /opt/local/lib/perl5/5.8.9/CPAN/Shell.pm line 1046 CPAN::Shell::failed('CPAN::Shell', 2, 1) called at /opt/local/ +lib/perl5/5.8.9/CPAN.pm line 413 eval {...} called at /opt/local/lib/perl5/5.8.9/CPAN.pm line 4 +13 CPAN::shell() called at -e line 1b/perl5/5.8.9/CPAN/Index.pm l +ine 85 CPAN::Index::reload('CPAN::Index') called at /opt/local/lib/pe +rl5/5.8.9/CPAN.pm line 692 CPAN::all_objects('CPAN=HASH(0x9b3d74)', 'CPAN::Distribution') + called at /opt/local/lib/perl5/5.8.9/CPAN/Shell.pm line 1046 CPAN::Shell::failed('CPAN::Shell', 2, 1) called at /opt/local/ +lib/perl5/5.8.9/CPAN.pm line 413 eval {...} called at /opt/local/lib/perl5/5.8.9/CPAN.pm line 4 +13 CPAN::shell() called at -e line 1
I don't know if this is a bug in CPAN or what I tried to reload the index but that also fails, I just installed CPAN v1.9402

Replies are listed 'Best First'.
Re: Problem with my CPAN module
by Corion (Patriarch) on Jun 28, 2010 at 11:51 UTC

    CPAN and many tools that stem from a unix mindset handle whitespace in path names very badly. The recommended fix is to avoid that.

    As a workaround, I would set the CPAN directory to a directory without any whitespace in its name. Then everything should work again.

      Its beyond sad that cpan still has problems with whitespace, hopefully cpanp doesn't have this problem

        It might help to remove all support for external helper programs from the CPAN configuration. That way it would fall back on the Perl modules doing the same things but avoid the shell or missing quotes when invoking shell programs.

        It might also help to construct test cases and open tickets for CPAN.

      That is just what was defaulted to in my Mac, would it be possible just to change this or would i have to just redo the entire configuration? If this is required then I would also do the next suggestion of just using the built in perl modules

        The easiest way to reconfigure just one thing is to know its name and to change that from within cpan:

        cpan> o conf foo bar

        The conf command lists all configuration items:

        cpan> o conf

        If you don't find things there, another way is to edit CPAN/Config.pm and to change the values there.

        As a somewhat related aside some advice:

        If you're going to be heavily using stuff from CPAN you probably will save yourself headaches in the long run if you install a separate copy of perl yourself somewhere else (e.g. under /usr/local from source, or by using macports) and install things from CPAN into that copy instead. That way n months down the road when Apple pushes a software update that diddles the OS' perl install you're not spending time trying to figure out why module X suddenly is rolled back to the "latest" version from 3 months back.

        The cake is a lie.
        The cake is a lie.
        The cake is a lie.