CRC Wiki
CRC Wiki
Log in

Perl

From CRC Wiki
PerlLogo.png

General Description

Perl 5 is a highly capable, feature-rich programming language with over 25 years of development. Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large scale development projects.

Basic Usage

You can invoke Perl from the command line with the following:

> perl


Default Perl Packages

The version of Perl on CRC systems is the default provided by our Redhat operating system. In general, this version of Perl comes with limited external packages. If you need a package that is not installed with the CRC version of Perl, then you can install additional packages locally using the following instructions.


Install Additional Packages Using CPAN

To begin with, start the CPAN shell:

 cpan

If this is the first time you have run CPAN, an interactive question and answer session will be started as it configures itself. You can accept all of the default options. Note that CPAN adds environment variables to your shell, so you may need to log out before Perl will find any recently installed packages.

When you arrive at the CPAN prompt, you can install the necessary package, like so:

 install PackageName

If there are any problems, double check spelling and case.


Install Additional Packages From File

  • Download the required Perl package
  • Unpack in your CRC space
  • Install the package to a local private repository of your choice e.g.
    perl Makefile.PL INSTALL_BASE=$HOME/directory_of_your_choice
  • Run Make command
make
make install
  • Point Perl5 library to the default (internal) and your local package repositories e.g.
setenv PERL5LIB $PERL5LIB:$HOME/directory_of_your_choice/perl5/x86_64-linux-thread-multi/Math/

(you may also want to include the above line in your .cshrc file)

  • The local package should now be accessible.

Further Information

See the official site: Perl