I just ran into this.
On CentOS, and other RedHat derivitives, it is recommended that you not install modules via CPAN, but rather with yum.
This is assuming you are adding modules to system Perl.

First you want to install the EPEL, as root:

# yum install epel-release

These three commands tell you what exists, what is installed, and what is available:

# yum list all # yum list installed # yum list available

Perl modules are prefixed with "perl-"

If you find the module you want from the available list, you can install it via:

# yum install -y perl-Module-I-Want

Note: Module::I::Want becomes perl-Module-I-Want via yum.

This all assumes that
a) you are root, and
b) you want to update system Perl

If either of these are not true you might want to investigate https://perlbrew.pl/
which I have not used, but was brought to my attention by mr_mischief, and has been recommended by several other monks.

Hope that helps,
cbeckley

Update: Log::Log4Perl is available in the EPEL.


In reply to Re: CPAN install module error by cbeckley
in thread CPAN install module error by staszeko

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.