In this article, we will explain how to check if Perl module is installed or not.
- 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”
- You will get the output look like above, showing no errors in calling a user function.
- 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/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.