Install another Perl on Linux?

In our development environment, another team uses Perl by default. Therefore, we should not touch it. How to install another Perl? How to install Perl modules using CPAN ?

+6
source share
3 answers

You need to download and install Perl from the source. You can download Perl from http://www.perl.org/get.html .

To use a different cpan from a different version of Perl, you cannot enter "cpan" because your Linux user will make default settings. Instead, you should run your "alternative" cpan with a complete alternative path. Run the root command and clear the hidden cpan folder from ".cpan" from the user's home.

+1
source

anyenv is a great platform for installing local versions of all open open environments, including Perl:

 $ git clone https://github.com/riywo/anyenv ~/.anyenv $ echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile $ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile # change profile if needed $ exec $SHELL -l 

This will configure anyenv . Here you have installed plenv, a Perl environment tool. Each of the environment tools allows you to manage these languages ​​in different installed versions.

 $ anyenv install plenv 

Now we can work with the plenv tool ...

List of available versions of Perl:

 $ plenv install --list 

Install the Perl 5.18.2 binary:

 $ plenv install 5.18.2 -Dusethreads 

Change global default Perl to 5.18.2:

 $ plenv global 5.18.2 

Change the local Perl project to 5.18.2:

 $ plenv local 5.18.2 

Run this command after installing the CPAN module containing the script executable:

 $ plenv rehash 

Install cpanm to the current Perl:

 $ plenv install-cpanm 

Install any modules from CPAN using

 $ cpanm JSON 

I use Carton to manage dependencies within a project and recommend that you take a look at it.

Now that you have anyenv , remember that you can learn other versions of other languages. anyenv is an invaluable tool.

 $ anyenv install --list Available **envs: denv jenv luaenv ndenv phpenv plenv pyenv rbenv 
+6
source

What does perlbrew mean.

After installing perlbrew, for example. via

 $ curl -L http://install.perlbrew.pl | bash 

(or App :: perlbrew from CPAN), you can use

 $ perlbrew install perl-5.18.2 $ perlbrew switch perl-5.18.2 
+3
source

All Articles