无法在@INC中找到Text / CSV_XS.pm

时间:2013-06-06 17:39:46

标签: perl

#!/usr/bin/perl
use strict;
use DBI;
use Text::CSV_XS;

每当我执行程序时,都会出现以下错误。我已正确安装模块,但我不知道为什么会出现此错误。

Can't locate Text/CSV_XS.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/WINAST/DHL/AGI/M_GET_AGENT_update.pl line 9.
BEGIN failed--compilation aborted at /usr/WINAST/DHL/AGI/M_GET_AGENT_update.pl

[root@localhost]# perldoc -l Text::CSV_XS.pm
/usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux/Text/CSV_XS.pm

[root@localhost]# instmodsh
Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
cmd? l
Installed modules are:
   DBI
   Date::Parse
   DateTime::Format::DBI
   My::Math
   Perl
   Test::Inter
   Test::NoWarnings
   Test::Tester
   Text::CSV_XS
   Time::Piece

1 个答案:

答案 0 :(得分:17)

在我看来,你的/ usr / bin / perl与/ usr / local / bin / perl不是一回事。

更改shebang以使用安装了Text :: CSV_XS的Perl,或者通过发出以下命令为您正在使用的perl安装Text :: CSV_XS:

 /usr/bin/perl -MCPAN -e'install Text::CSV_XS'