How to check whether a Perl module has been installed

May 19, 2023 / How-to Guide

In this article, we will explain how to check if Perl module is installed or not.

  1. You can run the following command from the shell to check whether a particular Perl module is installed on the server or not:
    perl -e “use Themodulename::Here”
    For Example: Let us test if Zlib is installed or not “A core Perl module installed by default on all systems”
    [root@carbondev ~]# perl -e “use Compress::Zlib”
    [root@carbondev ~]#
  2. You will get the output look like above, showing no errors in calling a user function.
  3. If there is no module installed, however you will get something like below output:
    [root@carbondev ~]# perl -e “use Soap::Lite”
    Can’t locate Soap/ in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at -e line 1.
    BEGIN failed–compilation aborted at -e line 1.

In this way, a Perl module’s installation status can be verified. For help get in touch with our support team.

Dominos Search