Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt
hiddentrue

One of the best things about Perl is the number of packages provided by the user community. Installing packages generally requires root access but that is not a viable solution in the HPC environment.

An easy solution is to use perl-virtualenv to create a consistent personal Perl environment that will persist for each time you log in. This section walks you through the process of creating and using your own Perl virtualenv.




Overview

Perl is installed on the operating system of each node and is currently at 5.16.3: 

Code Block
languagebash
themeMidnight
[netid@compute_hostname ~]$ perl --version

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 44 registered patches, see perl -V for more detail)
...


Perl Module Policy

We provide a version of perl through modules or the operating system and the user is expected to create their own perl environment using perl-virtualenv.

For a helpful Perl tutorial, see: http://www.tutorialspoint.com/perl/perl_modules.htm 
Additionally, O'Reilly Media is a well regarded source for Perl 

Installing Perl Packages Using perl-virtualenv

One of the best things about Perl is the number of packages provided by the user community. Installing packages generally requires root access but that is not a viable solution in the HPC environment.

An easy solution is to use perl-virtualenv to create a consistent personal Perl environment that will persist for each time you log in.  

Code Block
languagebash
themeMidnight
titleExample of creating and using a Perl virtual environment
[netid@i0n1 ~]$ perl-virtualenv my_project.    # Create virtual environment
perl path: /usr/bin/perl
venv path: /home/uxx/netid/my_project
[netid@i0n1 ~]$ source my_project/bin/activate # Activate virtual environment
(my_project)[netid@i0n1 ~]$ cpanm -i Config::Trivial
--> Working on Config::Trivial
Fetching http://www.cpan.org/authors/id/A/AT/ATRICKETT/Config-Trivial-0.81.tar.gz ... OK
Configuring Config-Trivial-0.81 ... OK
...
4 distributions installed
(my_project)[netid@i0n1 ~]$