Solved

How to find Perl modules available in Linux

Posted on 2011-03-16
3
586 Views
Last Modified: 2012-05-11
In a perl script, I see the below given Perl modules used in a script. Now I want to use this same script in another server.  How can I check if these modules are already available on other server?
I know if these Perl modules aren't available, it will give error while executing. But I just want to know the command line to search for availability of Perl modules on a server.


use XML::Simple;
use Data::Dumper;



[loguser@logllm01 ~]$ perl -e 'print join "\n", @INC'      =>  This just gives me the path where perl modules are located but I can't do search in this.
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl/5.8.7
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/5.8.8
.[loguser@logllm01 ~]$
0
Comment
Question by:ashsysad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 100 total points
ID: 35152853
Lots of different ways of doing this (as is perl's way)

Simplistically, you can do

perl -MXML::Simple -e1

or

perl -MFile::Find=find -MFile::Spec::Functions -Tlwe \
'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'


or depending on your perl version and platform, the following might work

perldoc perllocal

cpan -l

0
 
LVL 3

Assisted Solution

by:Abhishek_Chib
Abhishek_Chib earned 100 total points
ID: 35153432
Hi,

Follow instruction on  : http://www.cpan.org/misc/cpan-faq.html

Section : How do I find out what modules are already installed on my system?
0
 

Author Closing Comment

by:ashsysad
ID: 35153996
Thankyou so much !
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Six Sigma Control Plans
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question