Installing Perl libraries¶
Perl libraries can be installed to your home directory.
First, load a perl module.
Use module spider perl to view available perl modules on the cluster you are using.
In this example we will use a perl module available on Easley. Easley's perl modules don't need a separate compiler module loaded first.
Next, start an interactive cpan shell:
Direct cpan to your home directory:
Commit the changes to cpan:
Exit cpan:
Now, you need to modify your environment variables.
This can be done in the terminal using the following four commands, but would need to be done once per login session before installing perl libraries.
Alternatively, you can add these commands to your .bashrc file to have them happen automatically upon logging in.
$> export PERL_MM_OPT="INSTALL_BASE=$HOME/perl5"
$> export PERL5LIB="$HOME/perl5/lib/perl5:$PERL5LIB"
$> export PATH="$HOME/perl5/bin:$PATH"
$> eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
You can now use the cpan commands to install perl modules/libraries:
Some examples are:
Migrated from UNM-CARC QuickBytes (last source update 2026-07-30). Spotted a problem? Open an issue or pull request.
Machine-readable versions of this page: Markdown twin · raw source on GitHub · llms.txt · llms-full.txt (whole site). See For AI agents.