Bagels has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I am running Perl v5.16.3 on a Centos 7.1.1503 linux machine. I want to write a script to manipulate Google Spreadsheets. I found a module online, Net-Google-Spreadsheets-0.1501 that does this. However, there is a large number of prerequisites and the first one, Moose, has a bunch itself. So, I was wondering if there was a simple way to install a module and all of it's prerequisites. I tried using CPAN but it came back with all kinds of test failures.

Thanks, Bagels
  • Comment on Installing Google Spreadsheet Module with a lot of prerequisites

Replies are listed 'Best First'.
Re: Installing Google Spreadsheet Module with a lot of prerequisites
by hippo (Archbishop) on Jun 17, 2015 at 22:31 UTC

    There's no easy answer. You have a couple of options, though, and if this is intended to be a long-lived production server I strongly recommend giving all of these serious thought before choosing which one is right for you. Read around the subject both here at at the monastery and on the CentOS fora to get a feel for the pros and cons.

    You could continue to use the system perl, use packaged modules where you can (eg. use the perl-Moose package to get Moose and all its dependencies) and only install those modules from source which are not available as packages. You must be very careful not to overwrite the system modules if you do this.

    You could continue to use the system perl but set up your own personal library path and install all the modules required into that personal area from CPAN using an installer (cpan/cpanplus/cpanminus). This still takes a bit of care but you can do it all as a fairly unprivileged user which can help. Watch out for the contexts if you have SELinux enabled (which you should, of course).

    Or you could go the whole hog, leaving the system perl well alone and installing a fresh perl of your own choosing elsewhere (from source) and then install the modules with that perl into its own dedicated library paths. This seems to be the option favoured by most monks here but I wear many hats and when wearing my sysadm hat am less keen on this as it becomes a hassle and therefore a danger at medium scales.

    Whichever way you go, make a plan and stick to it. If it really does turn out to be the wrong choice it can be a bit of a nightmare to switch later. Good luck.

Re: Installing Google Spreadsheet Module with a lot of prerequisites
by ww (Archbishop) on Jun 17, 2015 at 23:08 UTC

    Unless you have a very good reason for using Google spreadsheets, consider an alternate: Open Office, Libre Office, other others avail for your Centos Libre Office's spreadsheet is largely compatible with MS Excel and can be used with jcmcnamara's Excel::Writer::XLS (at least on on Win32) while Spreadsheet::ParseExcel may also serve you well.

    But yes, sometimes we're jammed into using something that requires a lot of non-simple approaches.

      Thanks for all the responses. Sounds like cpanm and perlbrew might be my only hope to do this quickly and easily. I'll check those out.

      There isn't a version of perl out there that already includes Google modules is there?

      Thanks!
Re: Installing Google Spreadsheet Module with a lot of prerequisites
by jeffa (Bishop) on Jun 17, 2015 at 22:51 UTC

    cpanm makes this a lot easier. Combine this with perlbrew and you can better and more easily manage your perls and CPAN modules.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: Installing Google Spreadsheet Module with a lot of prerequisites
by Anonymous Monk on Jun 17, 2015 at 22:52 UTC

    I tried using CPAN but it came back with all kinds of test failures.

    Skip the tests