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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashcraft
    New Member
    • Jan 2011
    • 9

    #1

    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:
    provides:
    Text::CSV_XS:
    file: CSV_XS.pm
    version: 0.80
    requires:
    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:
    [CODE]
    use lib '/nfs/an/disks/an_home_disk013/';
    [/CODE

    I get the same error message.

    I tried this:
    Code:
    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:
    /nfs/an/disks/an_home_disk013/Text/CSV_XS
    Changed my use statment back to:

    Code:
    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.
    Attempting to login via cyradm fails because of a missing library. UPDATE 2007-09-15: I believe I have a fix for this. In Cyrus/IMAP/Shell.p...
  • Ashcraft
    New Member
    • Jan 2011
    • 9

    #2
    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

    Comment

    • RonB
      Recognized Expert Contributor
      • Jun 2009
      • 589

      #3


      Comment

      • Ashcraft
        New Member
        • Jan 2011
        • 9

        #4
        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:
        Code:
         perl Makefile.PL
              make
              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.

        Code:
        use lib '/nfs/an/disks/an_home_disk013/uell1/bin/Integ/Text-CSV_XS-0.80';

        Comment

        • RonB
          Recognized Expert Contributor
          • Jun 2009
          • 589

          #5
          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.

          Comment

          • Ashcraft
            New Member
            • Jan 2011
            • 9

            #6
            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."

            Comment

            • RonB
              Recognized Expert Contributor
              • Jun 2009
              • 589

              #7
              ./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

              Comment

              • Ashcraft
                New Member
                • Jan 2011
                • 9

                #8
                I would copy but when I do
                Code:
                  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_insta ll] Error 255

                So it looks like it is a permission issue. Thanks for the help!

                Comment

                • chorny
                  Recognized Expert New Member
                  • Jan 2008
                  • 80

                  #9
                  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.

                  Comment

                  Working...