Skip to main content


Hamilton supports using the Perl programming language and is available via the usual perl command.  The sections below have information on:

Installing Perl Modules

Each user is able to install Perl modules accessible only to them. As people will need different modules and versions of those modules, this is a useful way of giving users the flexibility to install software without waiting for the Hamilton administrators to install it for you.

Prior to attempting to install any Perl modules, you will need to execute the following command exactly (copy and paste is sensible, rather than typing it out by hand) and then log out:

echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc

Login to Hamilton again. The cpan command can now be used to install Perl modules under the perl5 folder in your home directory, e.g. cpan install JSON, and usable in your Perl programs with the usual use statement.

Running Perl jobs

Example Perl program, in file

#!/usr/bin/env perl
print("hello, world!\n");

Example job script to run a Perl program using a single CPU core:

# Request resources:
#SBATCH -c 1          # 1 CPU core
#SBATCH --mem=1G      # 1 GB RAM
#SBATCH -t 1:0:0  # 1 hour (hours:minutes:seconds)
# Run in the default queue
# (job will share node with other jobs)
#SBATCH -p shared
# Commands to be run:

Submit it to the queue with the command: sbatch