How do I install a Perl Module?

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:

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

3 comments… add one
  • Geo Varghese Dec 5, 2009 @ 16:10

    Try Perl Module Manager

    To Install perl modules and all dependent modules,Uninstall perl modules,List all perl modules in system,Search for a perl module in and system,List all files of a perl module and Details of a perl module.

    Download it from

    It will help you.

  • chiranjeevi Nov 26, 2010 @ 10:10

    can any one help me to istall perl “MIME lite” install and use?

  • Marek Jan 3, 2012 @ 21:48

    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 Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.