How to check whether a Perl module has been installed

Server / May 19, 2023

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”
    [[email protected] ~]# perl -e “use Compress::Zlib”
    [[email protected] ~]#
  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:
    [[email protected] ~]# perl -e “use Soap::Lite”
    Can’t locate Soap/Lite.pm 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.