Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install perl-JSON on centos

When I'm trying to run a perl script (on my centos 6 machine) I get this message:

Can't locate JSON.pm in @INC (@INC contains: 
/usr/local/lib/perl5/5.10.1/x86_64-linux-thread-multi 
/usr/local/lib/perl5/5.10.1 
/usr/local/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi 
/usr/local/lib/perl5/site_perl/5.10.1 .)...

After googling a bit, I found out that I need to install that module; But, when I'm typing:

sudo yum install perl-JSON

I get this message:

    ...
Setting up Install Process
Package perl-JSON-2.17-1.el5.noarch already installed and latest version
Nothing to do

What can I do in order to run that script?

My perl version is v5.10.1

Thanks,

like image 795
Noam Avatar asked Aug 01 '12 06:08

Noam


1 Answers

Try to install it via:

1) CPAN (cpan install)

$ sudo cpan JSON

2) CPAN minus (cpanm)

Install cpan minus

$ wget http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.5017.tar.gz
$ tar -zxvf App-cpanminus-1.5017.tar.gz
$ cd App-cpanminus-1.5017
$ perl make.pl
$ make 
$ make test
$ sudo make install

Then install it via cpanm

$ sudo cpanm JSON

I prefer work with CPAN modules via cpanm, because it's modern and easy way!

like image 59
Pavel Vlasov Avatar answered Sep 18 '22 21:09

Pavel Vlasov