How do I install a Perl Module?

Posted on in Categories , , , , , , , , , last updated May 4, 2007

Q. How do I install a Perl module under Linux or UNIX like operating system?

A. Perl modules (a Perl module is a discrete component of software for the Perl programming language) can be installed using various methods under different Linux distributions.

Task: Install perl module

If you are using Red Hat Linux then use up2date command to install most common modules:

# up2date module-name
Use following command to list all supported modules:
# up2date --showall | grep -i 'perl'
OR use yum command under CentOS/RHEL 5/Fedora core:
# yum list available 'perl'

If you are using Debian Linux, try to use apt-get command to install common perl module. However following is the recommended way to install a perl module.

A) Start CPAN Shell:
# perl -MCPAN -e shell

B) Install a perl module:
At cpan> shell prompt install module using install module::Name command. For example install module called MIME::Lite:
# cpan> install MIME::Lite
Alternatively, try out the following command:
# cpan -i MIME::Lite

See also:

3 comment

  1. Hi chiranjeevi

    For IIS Windows servers you probably need to have compiler “nmake.exe” 64bit version.
    If you are running plesk you will find a copy on C:\plesk \…..\…\.\nmake.exe
    copy this file to C:\Windows. If the “nmake.exe” is not there simply use search on drive C:\ and you may be lucky to find it somewhere, as other people suggest download and install MS Visual Studio, the nmake.exe will be there so search for it.

    Then you can use CPAN and it will download compile and install MIME lite for you. To do this use command prompt:
    perl -MCPAN -e shell [ENTER]
    cpan> install MIME::Lite [ENTER]
    there will be few dependancies to install as well, for these few questions the default answer is set to “yes” so all you need to do is click [ENTER] few times
    and you are done.
    cpan> exit [ENTER]
    close command prompt window.

Leave a Comment