Perl
Overview
On ARC clusters, there will be many different instances of perl and its extensions available.
“System” Perl
The “system” perl instance is the one distributed with the operating system. It will be available at the command line without loading any software modules. However, it will only have a limited set of extensions available and will be relatively old. It will provide basic, minimal funcationality, but is not our recommended perl. For example on a Tinkercliffs login node:
[user@tinkercliffs2 ~]$ which perl
/usr/bin/perl
[user@tinkercliffs2 ~]$ perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
Perl available as a software module
You can find a mutlitude of newer versions of Perl which are available on ARC clusters via software modules.
$ module spider Perl/5
---------------------------------------------------------------------------
Perl:
---------------------------------------------------------------------------
Description:
Larry Wall's Practical Extraction and Report Language Includes a
small selection of extra CPAN packages for core functionality.
Versions:
Perl/5.28.1-GCCcore-8.2.0
Perl/5.30.0-GCCcore-8.3.0
Perl/5.30.2-GCCcore-9.3.0
Perl/5.32.0-GCCcore-10.2.0
Perl/5.32.1-GCCcore-10.3.0
Perl/5.34.0-GCCcore-11.2.0
Perl/5.34.1-GCCcore-11.3.0-minimal
Perl/5.34.1-GCCcore-11.3.0
Perl/5.36.0-GCCcore-11.3.0
Perl/5.36.0-GCCcore-12.2.0
Perl/5.36.1-GCCcore-12.3.0
The modules prior to version 5.36.0 were bundled with a large number of common extensions, so loading the module will provide a more current Perl
and also many of the most commonly needed extensions to Perl. The module description will show the list of extensions available, for example module spider Perl/5.32.0-GCCcore-10.2.0
.
In versions labeled “minimal” AND in versions >5.36.0, these extensions are bundled separately from the basic Perl software module itself.
Perl extension bundles
The software module Perl-bundle-CPAN
provides a preloaded set of common Perl extensions which will fulfill the needs of many users.
BioPerl
is a collection of software written in Perl to serve BioInformatics needs and is a domain specific bundle of Perl extensions.
Installing extensions not avilable in the bundles
load Perl module
module load Perl[/version]
execute the following four lines only once, which will direct cpan to install packages into your home directory ~/perl5
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bashrc
echo 'export MANPATH=$HOME/perl5/man:$MANPATH' >> ~/.bashrc
source ~/.bashrc
install the package using cpan
cpan Package::Subpackage
check if you can load the package successfully
perl -e "use Package::Subpackage"