Skip to content

Instantly share code, notes, and snippets.

@crazyhottommy
Created August 2, 2017 17:08
Show Gist options
  • Save crazyhottommy/c0b2e00c8d90ce73c83bfca40b48de1d to your computer and use it in GitHub Desktop.
Save crazyhottommy/c0b2e00c8d90ce73c83bfca40b48de1d to your computer and use it in GitHub Desktop.

see https://gist.github.com/ckandoth/c16b9a423b54dc0a7a37 for installing perl5.22 locally

If you want to install modules for users without root. https://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user

wget -O- http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.profile
echo 'export MANPATH=$HOME/perl5/man:$MANPATH' >> ~/.profile

## now you can install
cpanm Module::Name

wget -O- http://cpanmin.us fetches the latest version of cpanm and prints it to STDOUT which is then piped to perl - -l ~/perl5 App::cpanminus local::lib. The first - tells perl to expect the program to come in on STDIN, this makes perl run the version of cpanm we just downloaded. perl passes the rest of the arguments to cpanm. The -l ~/perl5 argument tells cpanm where to install Perl modules, and the other two arguments are two modules to install. [App::cpanmins]1 is the package that installs cpanm. local::lib is a helper module that manages the environment variables needed to run modules in local directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment