15

I am new to using log4p and want to use the same for logging in my code. I am getting errors like:

Can't locate Log/Log4perl.pm in @INC

Which I understand is because of a missing library. Now, where and how do i get this library installed on my UNIX environment?

I tried installing:

yum install perl-Log-Log4perl-1.30-1.el6.noarch.rpm

This also failed. Am I not in the right track? Can someone give me a quick start up link which also tells how to install this package and from where?

nbro
  • 15,395
  • 32
  • 113
  • 196
learner
  • 365
  • 1
  • 2
  • 14

2 Answers2

28

The typical way to install packages for perl is to use cpan or its variations (cpanm, cpanp, etc). If it is packaged by your distro thats easier/faster, but if it is not, you would still be able to do it via cpan.

cpan Log::Log4perl

OR in a DOS command prompt enter

> cpan
> install Log::Log4perl

You can look up the packages you want and their exact package names at search.cpan.org

Check Wikipedia for information about CPAN

Sam B
  • 27,273
  • 15
  • 84
  • 121
Karthik T
  • 31,456
  • 5
  • 68
  • 87
  • Thanks Karthik, what does "cpan" do here – learner Jan 23 '13 at 01:50
  • 2
    cpan is like yum but only for perl. It installs 3rd party packages. CPAN (in caps) is a collection of all 3rd party code that can be installed and used by programmers. – Karthik T Jan 23 '13 at 01:52
  • running this command , at the end it says: make has returned bad status , install seems impossible – captain_a Aug 04 '15 at 10:59
1
1) Go to http://search.cpan.org/~mschilli/Log-Log4perl-1.46/
2) Download tar.gz archive
3) tar zxfv archive
4) go to the archive's folder
5) run "perl Makefile.PL"
6) run "make"
7) run "make test"
8) run "make install"

that's all.

VGM
  • 69
  • 14