Using Perl
- chrisreidy@arizona.edu
- ric@arizona.edu
- tmerritt@arizona.edu
- sarawillis@arizona.edu
Owned by chrisreidy@arizona.edu
Overview
Perl is installed on the operating system of each node and is currently at 5.16.3:Â
[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. Â
Example 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 ~]$