Solved

How to find Perl modules available in Linux

Posted on 2011-03-16
3
545 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
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video discusses moving either the default database or any database to a new volume.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now