The CSF2 has been replaced by the CSF3 - please use that system! This documentation may be out of date. Please read the CSF3 documentation instead. To display this old CSF2 page click here. |
Perl
Overview
Perl is a programming language which is particularly good for text manipulation.
Versions available: 5.10.1, 5.16.3, 5.20.1 and 5.20.2
Bioperl 1.6.1 is included in the 5.16.3 install and later.
Restrictions on use
Perl is open source. All users are able to access and use it.
Set up procedure
The default version of Perl on the CSF is 5.10.1 – you do not need to load a modulefile to access it.
To use version 5.20.2 please load the modulefile:
module load apps/gcc/perl/5.20.2
Running the application
Please do not run anything other than very short simple perl programs on the login node. All computational work must be run in batch. Please see the CSF SGE documentation for example job submission scripts.
Installing extra modules
If you try to run a Perl script and it fails to find a module, such as
Can't locate Term/ReadKey.pm in @INC ...
you can usually install the missing one in your home directory from the CPAN archive (unless what you’re running comes with specific different instructions).
First you have to configure the cpan
command to install into your home directory if you haven’t done so before. Run this and hit return at the prompt:
perl -MCPAN -e 'mkmyconfig'
You also need environment variables to point to what you’ve configured. To set that up conveniently, do the following (assuming you use the default shell):
eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
You might want to add that line to your .bashrc
file for future use.
Convert the file name from the error message into a module name by replacing /
with ::
, and then install it similarly to (for the above case):
cpan Term::ReadKey
Hit the return key at any prompts, and it should eventually install the new module under perl5
in your home directory. The procedure may take a while and print lots. The environment variable PERL5LIB
needs to be set to ~/perl5/lib/perl5
to find it; the eval
step above does that. You can install multiple modules by passing the names as arguments to cpan
, or just use cpan
multiple times.
The installation procedure will only work on the login nodes, but you can use the result on compute nodes as long as PERL5LIB
is set correctly. The installation will currently only work with the default Perl version, not the ones requiring modules; however, the result should be usable with other versions if the eval
step is done before loading the module.