LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2013, 11:14 AM   #1
sayhello_to_the_world
Member
 
Registered: May 2013
Posts: 220

Rep: Reputation: Disabled
how to check how many and which perl modules are running on my machine!?


hi there

well i wanted to see what kind of perl-modules are on my opensuse linux distri - i run opensuse 12.3.


well this is a bit funny isnt it:

PHP Code:
martin@linux-70ce:~>  perl -'print "$_ \n" foreach @INC' 
/usr/lib/perl5/site_perl/5.16.2/i586-linux-thread-multi 
/usr/lib/perl5/site_perl/5.16.2 
/usr/lib/perl5/vendor_perl/5.16.2/i586-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.16.2 
/usr/lib/perl5/5.16.2/i586-linux-thread-multi 
/usr/lib/perl5/5.16.2 
/usr/lib/perl5/site_perl/5.16.2/i586-linux-thread-multi 
/usr/lib/perl5/site_perl/5.16.2 
/usr/lib/perl5/site_perl 

martin@linux-70ce:~> 

it looks bit funny - do i have several perl-distris or what happened here.
note: how to find out which modules i have!?
 
Old 06-22-2013, 11:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by sayhello_to_the_world View Post
it looks bit funny - do i have several perl-distris or what happened here.
note: how to find out which modules i have!?
Try
Code:
perl -e 'print "rpm -qf  $_\n" foreach @INC'|/bin/sh|sort -u
 
Old 06-22-2013, 11:42 AM   #3
sayhello_to_the_world
Member
 
Registered: May 2013
Posts: 220

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Try
Code:
perl -e 'print "rpm -qf  $_\n" foreach @INC'|/bin/sh|sort -u
hi there
i will do so!!

many many thanks !

greetings

update


PHP Code:
o conf commit
martin
@linux-wyee:~/php>   firefox -repl
martin
@linux-wyee:~/phpperl -'print "rpm -qf  $_\n" foreach @INC'|/bin/sh|sort -u
file 
/home/martin/php is not owned by any package
perl
-5.16.0-3.5.1.i586
perl
-base-5.16.0-3.5.1.i586
perl
-B-Utils-0.21-2.1.2.i586
perl
-Class-C3-XS-0.13-12.1.2.i586
perl
-Class-Load-XS-0.04-4.1.2.i586
perl
-Data-Dump-Streamer-2.33-2.1.2.i586
perl
-Devel-GlobalDestruction-0.04-3.1.1.i586
perl
-Digest-MD4-1.5-154.1.2.i586
perl
-Digest-SHA1-2.13-11.1.2.i586
perl
-gettext-1.05-157.1.2.i586
perl
-HTML-Parser-3.69-12.1.2.i586
perl
-HTTP-Server-Simple-0.44-2.1.1.i586
perl
-List-MoreUtils-0.33-2.1.2.i586
perl
-Moose-2.0602-2.1.2.i586
perl
-Net-DBus-1.0.0-3.1.2.i586
perl
-Net-LibIDN-0.12-9.1.2.i586
perl
-Net-SSLeay-1.42-3.1.2.i586
perl
-Package-Stash-XS-0.25-4.1.2.i586
perl
-PadWalker-1.92-12.1.2.i586
perl
-Params-Util-1.07-2.1.2.i586
perl
-Sub-Name-0.05-21.1.2.i586
perl
-Task-Weaken-1.04-14.1.1.i586
perl
-Test-Exception-0.31-13.1.1.i586
perl
-Text-CSV_XS-0.87-2.1.2.i586
perl
-Unicode-Map-0.112-6.1.2.i586
perl
-Variable-Magic-0.48-2.1.2.i586
perl
-X11-Protocol-0.56-7.1.1.i586
perl
-XML-LibXML-1.95-4.1.2.i586
perl
-XML-NamespaceSupport-1.11-15.1.1.i586
perl
-XML-Parser-2.41-15.1.2.i586
martin
@linux-wyee:~/php

question - does this list "ALL" (!!) packages and modules on the whole machine!?
that is the question of the day....

look forward to hear from you

greets say

Last edited by sayhello_to_the_world; 06-22-2013 at 12:15 PM.
 
Old 06-22-2013, 03:44 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
List all perl modules, also modules that are manually installed, examples ..
1) http://stackoverflow.com/questions/1...d-cpan-modules
Code:
for my $path (@INC) {
    my @list = `ls -R $path/**/*.pm`;
    for (@list) {
        s/$path\///g;
        s/\//::/g;
        s/\.pm$//g;
        print;
    }
}
2) http://www.perlmonks.org/?node_id=868141

-
 
Old 06-22-2013, 03:57 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by sayhello_to_the_world View Post
does this list "ALL" (!!) packages and modules on the whole machine!?
No. The output of 'perl -e 'print "$_\n" foreach @INC';' only prints ~ and PERL \@INC paths. What 'rpm -qf' does is tell you if whatever you point it at is part of a package or not and if it is which package it's part of.
 
Old 06-22-2013, 05:02 PM   #6
sayhello_to_the_world
Member
 
Registered: May 2013
Posts: 220

Original Poster
Rep: Reputation: Disabled
hi there good day knudfl - and hello unSpawn


many thanks for your both answers! All is very helpful!

Quote:
Originally Posted by knudfl View Post
List all perl modules, also modules that are manually installed, examples ..
1) http://stackoverflow.com/questions/1...d-cpan-modules
Code:
for my $path (@INC) {
    my @list = `ls -R $path/**/*.pm`;
    for (@list) {
        s/$path\///g;
        s/\//::/g;
        s/\.pm$//g;
        print;
    }
}
2) http://www.perlmonks.org/?node_id=868141

-
many thanks . all looks impressive:



brian d Foy talks bout this App-Module-Lister/lib/Lister.pm


well can i run this in a NON -SERVER ENVIRONMENT!? TOO!?

i want to use it on my notebook

http://search.cpan.org/dist/App-Modu.../lib/Lister.pm

PHP Code:
cpan[6]>  install  App::Module::Lister 
Running install 
for module 'App::Module::Lister'
Running make for B/BD/BDFOY/App-Module-Lister-0.13.tar.gz
Fetching with LWP
:
http://cpan.mirror.anlx.net/authors/id/B/BD/BDFOY/App-Module-Lister-0.13.tar.gz
Fetching with LWP:
http://cpan.mirror.anlx.net/authors/id/B/BD/BDFOY/CHECKSUMS
Checksum for /home/martin/.cpan/sources/authors/id/B/BD/BDFOY/App-Module-Lister-0.13.tar.gz ok
Scanning cache 
/home/martin/.cpan/build for sizes
............................................................................DONE

  CPAN
.pmBuilding B/BD/BDFOY/App-Module-Lister-0.13.tar.gz

Checking 
if your kit is complete...
Looks good
Writing Makefile 
for App::Module::Lister
Writing MYMETA
.yml and MYMETA.json
cp lib
/Lister.pm blib/lib/App/Module/Lister.pm
Manifying blib
/man3/App::Module::Lister.3
  BDFOY
/App-Module-Lister-0.13.tar.gz
  
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY
=/usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/load.t .......... ok   
t/pod.t ........... ok   
t/pod_coverage.t .. ok   
All tests successful.
Files=3, Tests=3,  0 wallclock secs ( 0.04 usr  0.00 sys +  0.19 cusr  0.01 csys =  0.24 CPU)
Result: PASS
  BDFOY/App-Module-Lister-0.13.tar.gz
  /usr/bin/make test -- OK
Running make install
root's password:
Installing /usr/lib/perl5/site_perl/5.16.0/App/Module/Lister.pm
Installing /usr/share/man/man3/App::Module::Lister.3
Appending installation info to /usr/lib/perl5/5.16.0/i586-linux-thread-multi/perllocal.pod
  BDFOY/App-Module-Lister-0.13.tar.gz
  sudo /usr/bin/make install  -- OK

cpan[7]> 
the question is: is this script runnable on my laptop too?

Last edited by sayhello_to_the_world; 06-22-2013 at 05:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Check for condition on remote machine before running command? soupmagnet Linux - Newbie 2 01-03-2013 11:31 AM
problem with modules in perl running on linux RHEL 5.4 kingston Linux - Newbie 4 04-19-2011 01:34 AM
Print output of a script to screen using Perl/Multiple installation of Perl Modules metallica1973 Linux - General 1 02-17-2011 06:59 PM
problem with perl modules declaration and perl/cgi script shifter Programming 9 02-24-2010 10:09 AM
perl/bash script to monitor all processes running in my machine pudhiyavan Linux - Security 4 07-19-2005 03:09 PM


All times are GMT -5. The time now is 03:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration