Perl Module Installation issue.

I have issue with the perl module installed in the new Linux server

I have installed the required module, but still the perl program was not able to find the path

I'm getting the below error:

Can't locate Log/Log4perl.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/Log4perl.pm /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./audit.pl line 11.
BEGIN failed--compilation aborted at ./audit.pl line 11.

Linux version:

 
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

Perl version:

 
-bash-3.2$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi

Perl module Installed:

=head2 Mon Mar 11 07:51:56 2013: C<Module> L<Log::Log4perl|Log::Log4perl>
=over 4
=item *
C<installed into: /usr/lib/perl5/site_perl/5.8.8>
=item *
C<LINKTYPE: dynamic>
=item *
C<VERSION: 1.40>
=item *
C<EXE_FILES: eg/l4p-tmpl>
=back

Require your assistance please. :frowning:

What does ls /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl.pm return?

-bash-3.2$ ls /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl.pm
ls: /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl.pm: Permission denied
-bash-3.2$ whoami
arbatch

And when i log in as a root user

-bash-3.2$ sudo su - root
[sudo] password for arbatch:
[root@DI-FLOR-LBD396b ~]# ls /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl.pm
/usr/lib/perl5/site_perl/5.8.8/Log/Log4perl.pm
[root@DI-FLOR-LBD396b ~]#

Hmmm, I think I understand why the module wasn't loaded ...

How did you install the module?

I installed almost a month ago. Not sure of the exact steps i followed.

First ran cpan command and under the cpan prompt installed the module using

install "Log::Log4Perl"

Odd, that should have made it globally accessible, unless there's some unusual SELinux rule in place...

All entries in the standard @INC directories should be globally readable, they are analogous to /lib, /usr/lib, /usr/local/lib but for Perl rather than C

A thought does occur that perhaps you'd be better off having a non system (and more up to date) Perl installed alongside the system Perl, this would allow you install modules, write your own modules and generally muck about, without having an impact on the system's Perl installation (/usr/local/bin/perl as opposed to /usr/bin/perl. )

To achieve this in a manageable fashion take a look at perlbrew - search.cpan.org