Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't locate Text/CSV_XS.pm in @INC [closed]

Tags:

perl

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

Whenever I execute my program, I get the following error. I have installed module properly but i don't know why this error is showing.

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
like image 583
user1363308 Avatar asked Nov 30 '22 12:11

user1363308


1 Answers

Looks to me like your /usr/bin/perl and /usr/local/bin/perl are not the same thing.

Either change the shebang to use the Perl for which you have Text::CSV_XS installed, or install Text::CSV_XS for the perl you are using by issuing the following command:

 /usr/bin/perl -MCPAN -e'install Text::CSV_XS'
like image 142
Andy Lester Avatar answered Dec 20 '22 14:12

Andy Lester