在 centos 上安装 perl-JSON
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11753529/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install perl-JSON on centos
提问by Noam
When I'm trying to run a perl script (on my centos 6 machine) I get this message:
当我尝试运行 perl 脚本(在我的 centos 6 机器上)时,我收到以下消息:
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
我的 perl 版本是 v5.10.1
Thanks,
谢谢,
回答by Pavel Vlasov
Try to install it via:
尝试通过以下方式安装它:
1) CPAN (cpan install)
1)CPAN(cpan安装)
$ sudo cpan JSON
2) CPAN minus (cpanm)
2) CPAN 减 ( cpanm)
Install cpan minus
安装 cpan 减
$ 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
然后通过cpanm安装
$ sudo cpanm JSON
I prefer work with CPAN modules via cpanm, because it's modern and easy way!
我更喜欢通过 cpanm 使用 CPAN 模块,因为它既现代又简单!
回答by inMILD
Maybe this will help others. In my case, running in Centos 7:
也许这会帮助其他人。就我而言,在 Centos 7 中运行:
yum install cpan
then
然后
yum install cpanminus
回答by TamerDev
for cpan (not cpan minus):
yum install cpan
cpan JSON
对于 cpan(不是 cpan 减):
yum install cpan
cpan JSON

