Solved

How to find Perl modules available in Linux

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

16 Experts available now in Live!

Get 1:1 Help Now