Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Problem with Spreadsheet::XLSX..

by venkyPerl (Initiate)
on Aug 06, 2012 at 10:23 UTC ( #985648=perlquestion: print w/replies, xml ) Need Help??
venkyPerl has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I am new to perl and I am stuck on what seems to be a very basic thing. I had to work on a issue which deals with reading of Excel files in Perl. Currently, the application uses Spreadsheet::ParseExcel and reads Excel files with xls etension only (97 2003 format) but going forward, we have to read files with xlsx extension also. I studied that for doing this, we have to use Spreadsheet::XLSX package. But it seems i did not install the package correctly. I downloaded the tar files, unzip them n copied to my perllib directory. and when i tried testing my perl script, it gave me the following error -

Can't load '../perldir/auto/Compress/Raw/Zlib/' for module Comp +ress::Raw::Zlib: perl: fatal: ../perldir/auto/Compress/Raw/Z +lib/ wrong ELF data format: ELFDATA2LSB at /usr/perl5/5.8.4/l +ib/sun4-solaris-64int/ line 230. at ../perldir/Archive/ line 9 Compilation failed in require at ../perldir/Archive/ line 9. BEGIN failed--compilation aborted at ../perldir/Archive/ line 9. Compilation failed in require at ../perldir/Spreadsheet/ line 1 +1. BEGIN failed--compilation aborted at ../perldir/Spreadsheet/ li +ne 11. Compilation failed in require at line 7. BEGIN failed--compilation aborted at line 7.

Though the file - is available in the directory - ../perldir/auto/Compress/Raw/Zlib/ with all the permissions.

I am doing this on Solaris 10 with Perl, v5.8.4.

Please let me know where am I wrong and how to work on this. Quick reply is appreciated.

Thank you everyone.


Replies are listed 'Best First'.
Re: Problem with Spreadsheet::XLSX..
by Corion (Pope) on Aug 06, 2012 at 10:27 UTC
    Can't load '../perldir/auto/Compress/Raw/Zlib/' for module Compress::Raw::Zlib: perl: fatal: ../perldir/auto/Compress/Raw/Zlib/ wrong ELF data format: ELFDATA2LSB

    It seems that your Perl installation finds the wrong Zlib (or Compress::Zlib libraries. Potentially it finds the libraries for a different architecture.

    I suggest consulting with your system administrator about the best way forward and recommend that you learn about how to properly install modules.

    Manually copying files is not the proper way to install Perl modules. See local::lib, perlbrew and Yes, even you can use CPAN for approaches how to maintain your own Perl library separate from the libraries provided by the system.

      Thank Corion for your quick reply.

      But i was unzipping n copying the files in the same directory from where it was picking the files for Spreadsheet::ParseExcel.

      I have little help from others and basically I am on my own. :) with offcoz the help from this forum.

      It wud be a great help if you cud let me know the steps in which I can install the module correctly.

      Thanks. Venky

        I linked to various educative nodes. Please read them and apply their contents to your situation.

        If you have no system administrator to talk to about the architecture and operating system, this is even more reason to use your own version of Perl and/or your own Perl library instead of using the libraries provided by the operating system. You will have to learn about the operating system you are working on. I cannot help you there.

Re: Problem with Spreadsheet::XLSX..
by marto (Bishop) on Aug 06, 2012 at 10:52 UTC

    "I downloaded the tar files, unzip them n copied to my perllib directory."

    This isn't a sensible way to install modules. Use cpan Spreadsheet::XLSX to install the module and it's prerequisites correctly.

    I suggest setting up your own Perl on the system, and avoid using the system Perl which ships with Solaris. First of all Solaris uses this for some OS tasks and it's best left alone, secondly 5.8.4 is very old. See App::perlbrew for an easy way to achieve this.

      Thank you Corion and Marto .. i am going through the links provided. :)

      Thank you.


        One more question,

        how would i know which all are the current libraries used by Perl and where is it installed.

        I mean everything about the current Perl that I have on my system.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://985648]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-12-16 09:31 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (449 votes). Check out past polls.