Solved

How to find Perl modules available in Linux

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…

685 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