perl: warning: Setting locale failed.

前端之家收集整理的这篇文章主要介绍了perl: warning: Setting locale failed.前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
运行某些perl 编写的脚本时 会报出一下的错误
perl: warning: Setting locale Failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "zh_CN.ZHS16GBK"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't locate warning.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./perl_tac line 2.
BEGIN Failed--compilation aborted at ./perl_tac line 2.

以上问题分为两部分 (1)perl: warning: Falling back to the standard locale ("C"). 到这一句 为分界线,这个问题的解决方
                                  因为我是在普通用户下运行的  直接改当前用户的环境变量就可以 vi.bash_profile  在最后输入 export LC_ALL=C
或者
   vi /root/.bashrc
再最底部加上
   export LC_ALL=C
或者直接运行
   echo "export LC_ALL=C" >> /root/.bashrc
后执行一下:
   source /root/.bashrc 
                              (2)  can't locate warning.pm in @INC  不能定位warning 模块                                   如何查看perl 安装过的模块  find `perl -e 'print "@INC"'` -name "*.pm"                                后来发现 是use warnings 这忘记写s 了  

猜你在找的Perl相关文章