NOTE: I'm no longer looking for an answer to this specific question, because I'm using plenv instead. However, I would still like to know whether (and why) CPAN checks the versions of modules installed on @INC, when it should just be managing its own directory of modules.

Many modules fail when I try to install them in CPAN, including CPAN itself. This may be because my CPAN thinks it has lower versions of many modules. For example,

cpan[12]> upgrade JSON::PP Package namespace installed latest in CPAN file JSON::PP 2.24000 2.27300 MAKAMAKA/JSON-PP-2.2730 +0.tar.gz Running install for module 'JSON::PP' Running make for M/MA/MAKAMAKA/JSON-PP-2.27300.tar.gz Has already been unwrapped into directory /home/me/.cpan/build/JSON- +PP-2.27300-dwlFCV Has already been made Running make test Has already been tested successfully Running make install Already done cpan[13]> r JSON::PP Package namespace installed latest in CPAN file JSON::PP 2.24000 2.27300 MAKAMAKA/JSON-PP-2.2730 +0.tar.gz cpan[14]> quit Lockfile removed. ]$ rm -rf ~/.cpan/build/JSON-PP-2.27300-dwlFCV ]$ rm -rf ~/perl5/lib/perl5/JSON ]$ rm -rf ~/.cpan/sources/authors/id/M/MA/MAKAMAKA ]$ cpan cpan[1]> r JSON::PP CPAN: Storable loaded ok (v2.20) Going to read '/home/me/.cpan/Metadata' Database was generated on Fri, 29 May 2015 14:17:02 GMT Package namespace installed latest in CPAN file JSON::PP 2.24000 2.27300 MAKAMAKA/JSON-PP-2.2730 +0.tar.gz cpan[2]> force install JSON::PP ... Result: PASS MAKAMAKA/JSON-PP-2.27300.tar.gz /usr/bin/make test -- OK Running make install Prepending /home/me/.cpan/build/JSON-PP-2.27300-ZHQLK0/blib/arch /home +/me/.cpan/build/JSON-PP-2.27300-ZHQLK0/blib/lib to PERL5LIB for 'inst +all' Manifying blib/man1/json_pp.1 Appending installation info to /home/me/perl5/lib/perl5/x86_64-linux-t +hread-multi/perllocal.pod Installing /home/me/perl5/lib/perl5/JSON/PP.pm Installing /home/me/perl5/lib/perl5/JSON/PP/Boolean.pm MAKAMAKA/JSON-PP-2.27300.tar.gz /usr/bin/make install -j17 -- OK cpan[2]> r JSON::PP Package namespace installed latest in CPAN file JSON::PP 2.24000 2.27300 MAKAMAKA/JSON-PP-2.2730 +0.tar.gz
Why does it keep reporting version 2.24, even after I've removed the module and after I've installed 2.273 again?


In reply to CPAN frequently reports older module version by philgoetz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.