471,896 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.

How to install PERL module Text::CSV_XS needed for H.M.Brand's cvs2xls.pl?

I was trying to use H.M.Brands script cvs2xls.pl and got this message:Can't locate auto/Text/CSV_XS/is_quoted.al in @INC
I thought I must not have this module installed. Although my perl version is v5.8.5.
I tried a google search:
Does PERL v5.8.5 have the Text::CSV_XS; installed?
I didn't get good results from this.
I think it should be installed, after looking in CPAN dependcies I got this:
file: CSV_XS.pm
version: 0.80
perl: 5.005
DynaLoader: 0
IO::Handle: 0

I tried to install the module in case it is not installed. When I unzip the file it creates a directory:Text-CSV_XS-0.80

I acess it with:
use lib '/nfs/an/disks/an_home_disk013/';

I get the same error message.

I tried this:
Expand|Select|Wrap|Line Numbers
  1. use lib '/nfs/an/disks/an_home_disk013/Text-CSV_XS-0.80';
Same message.

So I tried to create a directory & copy all the files in directory Text-CSV_XS-0.80 to it so my directory is:
Changed my use statment back to:

Expand|Select|Wrap|Line Numbers
  1. use lib '/nfs/an/disks/an_home_disk013/';
Same message.

Has anyone had this problem before or have some insight? I'm kind of beginer PERL learner.
I tried searching for the "is_quoted.al"
grep -r "is_quoted.al" .
Its not there.

I tried a google search for my problem and didn't understand the solution or not sure its transferable to my problem.
Jan 21 '11 #1
8 20188
I found this but I'm trying to decipher it..and how to unchroot? I'm at a big company not sure I should mess around to much with what I don't understand. http://www.steveshipway.org/forum/vi...1f321a9438277f
Jan 21 '11 #2
Thanks! Those are some good resources. It looks like when I run the commands to install it everything works.
In your expereince when you just do the command:
Expand|Select|Wrap|Line Numbers
  1.  perl Makefile.PL
  2.       make
  3.       make test
Would your use statement include the newly created directory? So in my case the newly created directory is 'Text-CSV_XS-0.80'. I tried both ways and they didn't work. So it might be "Make sure you have the appropriate permissions to install the module in your Perl 5 library directory. Often, you'll need to be root." What is root? Although I didn't get any error messages when I run the install commands. Just when I try to execute my script.

Expand|Select|Wrap|Line Numbers
  1. use lib '/nfs/an/disks/an_home_disk013/uell1/bin/Integ/Text-CSV_XS-0.80';
Jan 21 '11 #4
589 Expert Mod 512MB
Did you do the 'make install'?

Since you didn't specify a custom PREFIX location when running the Makefile.PL and assuming the install was successful, then the module will be installed in its default location and will be found by perl within the @INC directories. So, you should not need the lib statement. You'll need to use a standard 'use Text::CSV_XS;' statement.

If you did specify a PREFIX, then you will need to use the lib statement prior to the 'use Text::CSV_XS;' statement and the lib statement should point to the directory that you specified in the PREFIX statement.
Jan 22 '11 #5
Yes I did the 'make' install and didn't specify a PREFIX location.
It looks like installed correctly. I get the message:
"All tests successful, 2 tests skipped."

I think it might be a permission issue. Is there a way to check if you are statically or dynamically linked? I'm waiting to hear back from IT on this.

" Most Unix systems have dynamic linking -- if yours doesn't, or if for another reason you have a statically-linked perl, and the module requires compilation, you'll need to build a new Perl binary that includes the module. Again, you'll probably need to be root."
Jan 24 '11 #6
589 Expert Mod 512MB
./blib/lib/ is the build directory which is not (or should not be) part of the list of directories in the @INC array.

The auto at the beginning of that path is part of the path to where the module was installed.

The error you received indicates to me that you made several failed attempts to install the module and possibly the 2 skipped tests are related to the use of the is_quoted() sub.

You could try and copy the is_quoted.al file under ./blib to auto/Text/CSV_XS/

If that doesn't work I'd completely uninstall the module and delete all of its build directories, then try to reinstall.

When you reinstall, redirect all output to a file for later inspection. It's possible that you'll find non fatal build errors that relate to is_quoted.al
Jan 24 '11 #7
I would copy but when I do
Expand|Select|Wrap|Line Numbers
  1.   grep -r "is_quoted.al" .
the file isn't in ./blib.

But when I do direct my output I get:
"Warning: You do not have permissions to install into /usr/pkgs/perl/5.8.5/lib/site_perl/5.8.5/x86_64-linux at /usr/pkgs/perl/5.8.5/lib/5.8.5/ExtUtils/Install.pm line 114.
Cannot forceunlink /usr/pkgs/perl/5.8.5/lib/site_perl/5.8.5/x86_64-linux/auto/Text/CSV_XS/CSV_XS.so: Read-only file system at /usr/pkgs/perl/5.8.5/lib/5.8.5/File/Find.pm line 874
make: *** [pure_site_install] Error 255

So it looks like it is a permission issue. Thanks for the help!
Jan 24 '11 #8
80 Expert
perl does not include Text::CSV/Text::CSV_XS modules. You need to install them. Or for Text::CSV you can just provide path to it. Text::CSV_XS requires compilation (it is the variant of Text::CSV written in C for speed, modern Text::CSV will automatically use it if it is installed). You can install it with CPAN shell (you would need to be root for this).

> perl -MCPAN -e "shell"
cpan> install Text::CSV_XS

Upgrading CPAN shell itself is also a good idea - you have an old Perl.
cpan> install CPAN

There are also possibilities to install without requiring root, but they are harder.
Jan 26 '11 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Envex Developments | last post: by
reply views Thread by Envex Developments | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.