Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Error on Text/CSV.pm when running Perl Script [duplicate]

When running a Perl Script that grabs content from an Oracle DB and exports the results into a CSV, I am getting this error when trying to run it via the command line:

Can't locate Text/CSV.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.16.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.16.2
/usr/lib/perl5/vendor_perl/5.16.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.16.2
/usr/lib/perl5/5.16.2/x86_64-linux-thread-multi /usr/lib/perl5/5.16.2
/usr/lib/perl5/site_perl/5.16.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.16.2 /usr/lib/perl5/site_perl .) at
./OracleScript.pl line 4. BEGIN failed--compilation aborted at
./OracleScript.pl line 4.

I interpret this to mean that the Module is not installed. So, I tried to install it with the following command:

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

I get this error:

Database was generated on Mon, 06 Oct 2014 10:41:02 GMT Warning:
Cannot install Text::CSV_pm, don't know what it is. Try the command

    i /Text::CSV_pm/

to find objects with matching identifiers.

Can anybody shed some light on my issues, and how to remedy this?

like image 986
NerdyBird Avatar asked Dec 07 '22 00:12

NerdyBird


1 Answers

Given that you're using the system Perl (and, from a comment, it seems you have root) then the easiest approach is probably to install the package that is pre-built for your Linux distribution.

For a Debian/Ubuntu-based system:

$ sudo apt-get install libtext-csv-perl

For a RedHat/Centos/Fedora-based system:

$ sudo yum install perl-Text-CSV
like image 106
Dave Cross Avatar answered May 03 '23 01:05

Dave Cross