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 32, subversion 1 (v5.32.1) 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.36.1-GCCcore-12.3.0
        Perl/5.38.0-GCCcore-13.2.0
        Perl/5.38.0
        Perl/5.38.2-GCCcore-13.3.0
        Perl/5.40.0-GCCcore-14.2.0

The module description will show the list of extensions available, for example module spider Perl/5.40.0-GCCcore-14.2.0.

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.

$ module spider Perl-bundle

-----------------------------------------------------------------------------------------------------------
  Perl-bundle-CPAN:
-----------------------------------------------------------------------------------------------------------
    Description:
      A set of common packages from CPAN

     Versions:
        Perl-bundle-CPAN/5.36.1-GCCcore-12.3.0
        Perl-bundle-CPAN/5.38.0-GCCcore-13.2.0
        Perl-bundle-CPAN/5.38.2-GCCcore-13.3.0

BioPerl is a collection of software written in Perl to serve BioInformatics needs and is a domain specific bundle of Perl extensions.

$ module spider BioPerl

-----------------------------------------------------------------------------------------------------------
  BioPerl:
-----------------------------------------------------------------------------------------------------------
     Versions:
        BioPerl/1.7.8-GCCcore-12.3.0
        BioPerl/1.7.8-GCCcore-13.3.0
        BioPerl/1.7.8

Installing extensions not avilable in the bundles

  1. Load Perl module module load Perl[/version]

  2. 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 
  1. Install the package using cpan cpan Package::Subpackage

  2. Check if you can load the package successfully perl -e "use Package::Subpackage"