• Can't locate IPC/Run.pm in @INC


    编译perl,出现错误如下:

    Can't locate IPC/Run.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) at ./check_ipmi_sensor line 35.

    解决方法:

    原文参考:http://nets.ucar.edu/nets/intro/staff/siemsen/tools/perl.html#log4perl

    Installing Perl modules with CPAN.pm (best way)

    Use the CPAN.pm module. To read about it, do "perldoc CPAN", or in XEmacs use the Perldoc pull-down when you're editing a Perl file.

    The first time you use CPAN.pm, it will ask a long series of questions, the answers for which can be found below. Don't answer them until you've installed ncftp on the local machine.

    If you've already installed CPAN and just want to use it, do like

    (as root)
    (sudo) perl -MCPAN -e shell
    install Log::Log4perl
    install HTML::TokeParser::Simple
    h
    q
    	

    The above will install Log4perl in /usr/lib/perl5/site_perl/5.6.1/Log/Log4perl.

    I've had it happen that after a successful install like the above (no failure messages during the install) a Perl program still coudn't find the module. The .pm file was there, and in a directory listed in Perl's INC paths, but I still got the "Can't locate xyz.pm in @INC" message. It turned out that some of the intermediate directories above the .pm file were protected without 'x', so I didn't have permissions to read the directories. To fix it at the time, I did

    (as root)
    find /usr/local/lib/site_perl -type d -exec chmod +x {} \;
    		

    The CPAN.pm module will store modules in, like, /usr/local/lib/perl5/site_perl/5.8.4, with your version of perl. If you run CPAN.pm with a different version of perl, modules will get stored in a different place.

  • 相关阅读:
    最新版 VS2015|Visual Studio Enterprise 2015简体中文版(企业版)
    MY97 日期控件只输入今天之前的值
    VARIANT类型
    C++ Struct
    MFC网络编程
    套接字编程(VC_Win32)
    套接字相关函数
    网络编程
    char str[] 与 char *str的区别详细解析
    Windows下C++多线程同步与互斥简单运用
  • 原文地址:https://www.cnblogs.com/church/p/2584864.html
Copyright © 2020-2023  润新知