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
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!
Maybe this will help others. In my case, running in Centos 7:
yum install cpan
yum install cpanminus
for cpan (not cpan minus): yum install cpan cpan JSON