yuxing 发表于 2018-8-31 08:14:26

查看perl模块和cpan模块介绍

  1. Check whether you have 'perl-CPAN‘ package installed in your system.
  For checking ‘perl-CPAN’ package run following in your shell.
  # 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
  # perl -MCPAN -e shell
  Terminal does not support AddHistory.
  cpan shell -- CPAN exploration and modules installation (v1.9402)
  Enter 'h' for help.
  cpan>
  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> install MIME::Entity
  cpan> install MIME::Parser
  cpan> install Crypt::PasswdMD5
  cpan> install Term::ReadPassword
  cpan> install Crypt::CBC
  cpan> install Crypt::Blowfish
  cpan> install Daemon::Generic
  cpan> install DateTime
  cpan> install SOAP::Lite
  Alternative for second and third step.
  # perl -MCPAN -e 'install HTML::Template'
  # perl -MCPAN -e 'install MIME::Entity'
  # perl -MCPAN -e 'install Crypt::PasswdMD5'
  # perl -MCPAN -e 'install Term::ReadPassword'
  # perl -MCPAN -e 'install Crypt::CBC'
  # perl -MCPAN -e 'install Crypt::Blowfish'
  # perl -MCPAN -e 'install Daemon::Generic'
  # perl -MCPAN -e 'install DateTime'
  # perl -MCPAN -e 'install SOAP::Lite'

页: [1]
查看完整版本: 查看perl模块和cpan模块介绍