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

I have a computer-programming background, but readily admit that I am not very knowledgeable in Perl, and my Unix experience was awhile ago, so I apologize in advance for possibly asking naive questions. But I need some help!

My workstation is a PC running Windows 10, and my organization uses a Linux server. I can access our files on the server with FTP.

We have a web application that lets users fill out an HTML form, which (when they hit "Submit") invokes a Perl program on our server. I created this Perl program by borrowing code from Matt's Formmail. My Perl program sends usefully-formatted email to a member of our organization. It works fine.

Now I want the Perl program to also update a Google spreadsheet. So I found the Perl Module called Net::Google::Spreadsheets. And I can't figure out how to install it on our server!

I downloaded the module to my PC and unzipped it. I created a lib directory on our server, and copied the downloaded files and directories under lib onto the server. Just to be safe, I gave 777 permissions to all of these files and directories. For an initial trial, I simply added the following two statements near the beginning of my Perl program:

use lib '../../lib'; use Net::Google::Spreadsheets;

(Note that my Perl program is located in cgi-bin/formmail/, so it must look two levels up to find lib.)

But when I run the program it gets a General Error. My guess is that it isn't finding all of the pieces of Net::Google::Spreadsheets. I looked at the code within the Spreadsheets module, and found what appear to be references to other Modules. These are things I did not download because I didn't know about them. Must I now download all of those modules? And what if they refer to still other modules?

Is there a straightforward way to install ALL of the Perl stuff I need onto my server? I tried to read articles in PerlMonks about installing Modules, but they seem to assume that I am logged directly into the server - unfortunately my access to the server is only via FTP.

Can one of you kind people help me? Thanks.

-- ted201

Replies are listed 'Best First'.
Re: Installing GoogleAPI on my server
by choroba (Cardinal) on Sep 03, 2016 at 20:23 UTC
    Instead of copying files somewhere, one usually uses the cpan command to install modules. To install a distribution from its tgz file, copying the lib files might not be enough - the common ways are either
    perl Makefile.PL make make test make install

    or

    perl Build.PL ./Build ./Build test ./Build install

    See also cpanm.

    You can try installing on a clone of the server and copying the installed files to the real one, but make sure the two systems are really identical. Also, carefuly study the output of the install step to find out what files were installed and where.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re: Installing GoogleAPI on my server
by Linicks (Scribe) on Sep 03, 2016 at 20:16 UTC

    "unfortunately my access to the server is only via FTP."

    You need to contact the admin of the server to install requirements - FTP is just what is says.

    Nick

Re: Installing GoogleAPI on my server
by hippo (Archbishop) on Sep 04, 2016 at 11:59 UTC
    I created this Perl program by borrowing code from Matt's Formmail.

    Just on this one point - you may well be unaware of the poor security reputation of that particular script. See for example the CVE entries for it. Please be very, very careful if you are deploying this script or one based upon it to a public-facing web server.

    If you must use something based upon this script (and really you shouldn't have to) consider the NMS rewritten version instead.

      In the old days (circa 2000), Mat was known in inner circles as 'Matt Wrong'. Remember how many web forum dates changed to 19100 at the turn of 2000 :)