Norwegian version of this page

Install Perl modules in TSD

How to install Perl modules from the CPAN mirror in TSD

Instructions for Linux users

We have created a copy of CPAN inside TSD (https://cpan.tsd.usit.no) so Perl modules that are not already installed can be installed in the user home areas.

If you've access to software modules, load a Perl module (or else use the system installed Perl):

module load Perl/<version>

Then configure your environment to use the TSD CPAN mirror, home directory installation path and build directory (optional):

# set local installation dir
eval $(perl -Mlocal::lib)

# set directory where CPAN modules are built, not installed
export PERL_CPANM_HOME=/tmp/cpanm_$USER

# configure cpanm to install packages from internal TSD mirror
export PERL_CPANM_OPT='--from https://cpan.tsd.usit.no/'

You can now manage module installations using the following commands:

# Install a module
cpanm Chess

# Check if the Perl module installed correctly:
perl -MChess -e 'print "ok\n"'

# Check all installed Perl modules:
instmodsh
cmd? l

# Check where a Perl module is installed:
cmd? m Chess
d

# Uninstall a Perl module:
cpanm --uninstall Chess

Or in a script:

#!/usr/bin/env perl
use strict;
use local::lib;
use Chess;
 
Search the user manual
Contact support

Call us

Opening hours are weekdays from 08:30 to 17:00 and Saturdays from 10:00 to 15:00.

Phone number: 22 84 00 04

Register case

Your request can be sent to it-hjelp@uio.no.

Send email

Book a Zoom meeting

Students and employees can book a Zoom meeting with UiO Helpdesk. Available hours are Tuesday to Thursday between 11:00 and 13:00.

Book a video call

Chat with us

Our chat is open every weekday between 09:00 and 16:00.

Start chat
Did you find what you were looking for?
Published June 21, 2021 10:57 AM - Last modified Jan. 25, 2024 2:01 PM