加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

查看perl模块和cpan模块介绍

发布时间:2020-12-16 00:13:25 所属栏目:大数据 来源:网络整理
导读:? 如何才能知道自己装了哪些PERL的模块? rpm?-qa?|?grep?perl* ?Can't locate CGI.pm“?? 可以使用perl -MCPAN -eshell再install CGI ? 用CPAN安装Perl模块时遇到的Can't?locate?CPAN.pm?in?@INC?问题解决方法 ? CPAN 是 Comprehensive Perl Archive Network

?

如何才能知道自己装了哪些PERL的模块?

rpm?-qa?|?grep?perl*

?Can't locate CGI.pm“?? 可以使用perl -MCPAN -eshell再install CGI

?

用CPAN安装Perl模块时遇到的Can't?locate?CPAN.pm?in?@INC?问题解决方法

?

CPAN Comprehensive Perl Archive Network 的缩写 . 。它是一个巨大的 Perl 软件收藏库,收集了大量有用的 Perl 模块 (modules) 及其相关的文件。这里主要是使用 Perl-Net-SNMP 模块。
问题描述:
[root@CactiEZ download]# perl -MCPAN -e shell
Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .).
安装perl模块的步骤如下:

1. Check whether you have?'perl-CPAN‘ package installed in your system.

For checking ‘perl-CPAN’ package run following in your shell.

[root@host13 ~]# rpm -q perl-CPAN

If perl-CPAN package is installed,you will get the output like this

perl-CPAN-1.9402-116.fc13.i686

else,you will get output like this

package perl-CPAN is not installed

and that the case you need to install it. You can install it via using yum,?yum install perl-CPAN?or from rpm,from “rpm.pbone.net” you can obtain “perl-CPAN rpm’s”.

2. Running the command?"perl -MCPAN -e shell"?will brought you to a CPAN command prompt

[root@host13 ~]# perl -MCPAN -e shell

Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)

Enter 'h' for help.

cpan[1]>

Note : If this is the first time you’ve run CPAN,it’s going to ask you a series of questions – in most cases the default answer is fine.

If you got an error given below,then you need to confirm the?"perl-CPAN"?package’s?existence in the sytem

Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/local/share/perl5 /usr/lib/perl5 /usr/share/perl5 /usr/share/perl5 /usr/lib/perl5 /usr/share/perl5 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl .).

BEGIN failed--compilation aborted.

3. From this command prompt you can install the perl modules.

Examples:

cpan[1]> install MIME::Entity

cpan[1]> install MIME::Parser

cpan[1]> install Crypt::PasswdMD5

cpan[1]> install Term::ReadPassword

cpan[1]> install Crypt::CBC

cpan[1]> install Crypt::Blowfish

cpan[1]> install Daemon::Generic

cpan[1]> install DateTime

cpan[1]> install SOAP::Lite

Alternative for second and third step.

[root@host13 ~]#?perl -MCPAN -e 'install HTML::Template'

[root@host13 ~]#?perl -MCPAN -e 'install MIME::Entity'

[root@host13 ~]#?perl -MCPAN -e 'install Crypt::PasswdMD5'

[root@host13 ~]#?perl -MCPAN -e 'install Term::ReadPassword'

[root@host13 ~]#?perl -MCPAN -e 'install Crypt::CBC'

[root@host13 ~]#?perl -MCPAN -e 'install Crypt::Blowfish'

[root@host13 ~]#?perl -MCPAN -e 'install Daemon::Generic'

[root@host13 ~]#?perl -MCPAN -e 'install DateTime'

[root@host13 ~]#?perl -MCPAN -e 'install SOAP::Lite'

?参考:http://blog.sina.com.cn/s/blog_645e2f0b01012npz.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读