in reply to How to install Perl modules locally on Unix?

Try using "The bootstrapping technique" from the local::lib docs to install that module. I recently used this on a host without admin rights and without an existing local::lib installation and I don't remember having any trouble. Afterwards I used cpanm -l ~/perl5 Module::Name to install modules there and it worked fine (Update: IIRC the -l ~/perl5 was necessary because I hadn't yet set up the environment variables at that point). In fact, here's a copy-and-paste from the .bash_history with a few irrelevant commands removed:

wget http://search.cpan.org/CPAN/authors/id/H/HA/HAARG/local-lib-2.000 +024.tar.gz tar xzvf local-lib-2.000024.tar.gz cd local-lib-2.000024 perl Makefile.PL --bootstrap make test && make install cd .. rm -rf local-lib-2.000024* cpanm -l ~/perl5 ...

While you should set up the environment variables in .bashrc/.cshrc as described in the local::lib docs, your web server will almost certainly disregard those. IMO it's often easiest to just specify an absolute pathname in your CGI script via use lib '/path/to/modules';, but whether that's always the best approach depends on your circumstances (like in case this script is being deployed on different hosts with different directory structures).

cpanm happened to already be installed there, but in case it isn't, it also has a simple installation option: curl -L https://cpanmin.us | perl - App::cpanminus (see App::cpanminus).

A few edits for clarity.

Replies are listed 'Best First'.
Re^2: How to install Perl modules locally on Unix?
by slugger415 (Monk) on Nov 27, 2017 at 22:28 UTC

    Thank you for the suggestions and instructions. I was able to install local::lib in my home directory, but don't have cpanm and though I tried to install it with cpan install I still can't get it to run.

    -bash: cpanm: command not found
      I was able to install local::lib in my home directory,

      Did you set up the environment variables as described in the local::lib docs? For example, for bash, the docs suggest: echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >>~/.bashrc

      Note that you have to log out and log back in once for this to take effect.

      but don't have cpanm

      Did you try the installation command I showed from the App::cpanminus docs (after setting up the environment vars)? That is: curl -L https://cpanmin.us | perl - App::cpanminus

        Ok I was able to get it working by running the EXPORT commands from the command line. I'll work with my service provider to figure out how to automate that.

        Thanks so much for your help, I'm up and running!

        Scott

        Hi, yes I did add that line to .bashrc and ran the curl command - still not able to run cpanm.

        Thanks for helping.