无法在Perl中找到DBI.pm模块 [英] Unable to locate DBI.pm module in Perl

查看:1459
本文介绍了无法在Perl中找到DBI.pm模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是CentOS,我已经安装Perl 5.20和Perl 5.10默认存在。

I am using CentOS, and I have installed Perl 5.20 and Perl 5.10 was present by default.

我使用Perl 5.20版本来执行Perl代码

I am using the Perl 5.20 version to execute the Perl code

我试图使用DBI模块并收到此错误

I am trying to use the DBI module and get this error

[root@localhost ~]#perl -e 'use DBI;'
Can't locate DBI.pm in @INC (you may need to install the DBI module) (@INC contains: /usr/local/lib/perl5/site_perl/5.20.1/i686-linux /usr/local/lib/perl5/site_perl/5.20.1 /usr/local/lib/perl5/5.20.1/i686-linux /usr/local/lib/perl5/5.20.1 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.




  • 如何检查所有已安装的Perl版本?

    • How to check for all installed versions of Perl?

      是否安装了DBI或任何模块?

      How do I check whether the DBI or any module is installed?

      如何解决此错误以便我可以使用DBI模块?

      How to resolve this error so that I can use DBI module?

      推荐答案


      如何检查所有已安装的perl版本?

      How to check for all installed versions of perl?




      • 正如Sobrique在注释中建议的,你不应该触摸系统perl。我建议您使用 perlbrew 。使用perlbrew你可以从本地用户安装不同版本的perl,并使用perlbrew检查perl的所有安装版本只是 $ perlbrew -l <​​/ code>。

        • As Sobrique suggested in comments, you should never touch system perl. I'd suggest using perlbrew. With perlbrew you can install different versions of perl from local user, and to check all installed versions of perl using perlbrew just do $ perlbrew -l.

        • 如何在执行程序时在它们之间切换?

          how to switch between them while executing a program?

          安装多个perls

          $ perlbrew -v install perl-5.20.0
          $ perlbrew -v install perl-5.13.4
          

          在他们之间切换

          $ perlbrew switch perl-5.20.0
          $ perlbrew switch perl-5.13.4
          

          有关详细信息,请参阅此文章:使用App :: perlbrew和App :: cpanminus安装多个Perls

          See this article for more details: Installing Multiple Perls with App::perlbrew and App::cpanminus


          是否安装了DBI或任何模块?

          How do I check if DBI or any module is installed?



查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆