1

Hi I sit behind a firewall at work unable to get a direct route to the internet but wanting to install a version of Perl for Linux that comes with, or is capable of being made to run Spreadsheet-ParseXLSX.

I am modifying a program that uses Spreadsheet-ParseExcel to work with xlsx files but an new to perl installations and only have user access.

Help would be appreciated.

Paddy3118
  • 4,704
  • 27
  • 38
  • 1
    http://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user – simbabque Jul 03 '15 at 08:28
  • Thanks simbabque. I am also worried about having an older version of Perl than that required to run Spreadsheet-ParseXLSX. Is there a potted version of Perl I could install that has everything I need? – Paddy3118 Jul 03 '15 at 09:25
  • Use can use http://www.perlbrew.com to get a different Perl than the system one. Perl doesn't come bundled with CPAN stuff, you need to install that. Are you developing on the system that will run the script in production? Can you make sure it will work in production? If it's not possible to install the dependency modules on the target machine, take a look at App::Fatpacker to bundle the deps into your script. – simbabque Jul 03 '15 at 09:27
  • http://matrix.cpantesters.org/?dist=Spreadsheet-ParseXLSX+0.17 – simbabque Jul 03 '15 at 09:27

1 Answers1

1

In general you can get along fine by copying the perl modules from a distribution into a directory of your choice on the server, adding said directory to the PERL5LIB environment variable. Observe the local directory structure the distribution defines for its files. In the case of Spreadsheet::Parse, that would be:

_your dir_
    Spreadsheet
        ParseExcel
            ...(lots of stuff)...
        WriteExcel
            ...(lots of stuff)...
        XLSX
            Fmt2007.pm
            Utility2007.pm
        ParseExcel.pm
        WriteExcel.pm
        XLSX.pm

Offhand I don't remember any dependencies that aren't satisfied by the core modules of 5.10 - however, if there are some, your perl will tell you ;-).

A slightly more robust method is to install the modules on a local machine under your control using eg. the CPAN module and copy the files from the build subdirectory or the site_perl subdirectory of your perl installation.

Caveat

This practice will only work reliably with pure perl modules !

It will always be better to address the sys admin people and ask them nicely to install the needed modules!

collapsar
  • 17,010
  • 4
  • 35
  • 61
  • Thanks. I will build an environment on my home machine and tar.gz it over.Our local IT just enforce the world-wide policy (I've tried before), but they don't mind me sticking stuff in my home directory - I think. (Although getting it there is tortuous. – Paddy3118 Jul 03 '15 at 17:47