How to check if a Perl module is installed or not on ubuntu?

Okay this is interesting. I learned today that Perl has several modules which are bundled together like SimpleXML, Archive Zip and so on. So, how do we find out whether a particular Perl module is installed on the machine or not?

The solution is tracking the location of the module on our machine. That can be done by installing perldoc which returns us the module’s location if it is installed on the machine.

Installing Perldoc is simple: Just run sudo apt-get install perldoc

Next step, if one wants to find out whether the Archive Zip module is installed, simply run the following command:

perldoc -l Archive::Zip and press enter. That would return you something like this : /usr/share/perl5/Archive/ if the module exists

if the module doesn’t exists, it returns something like this : “No documentation found for “Archive::Zip””




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s