LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to check how many and which perl modules are running on my machine!? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-check-how-many-and-which-perl-modules-are-running-on-my-machine-4175466996/)

sayhello_to_the_world 06-22-2013 10:14 AM

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!?

unSpawn 06-22-2013 10:24 AM

Quote:

Originally Posted by sayhello_to_the_world (Post 4976612)
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

sayhello_to_the_world 06-22-2013 10:42 AM

Quote:

Originally Posted by unSpawn (Post 4976621)
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

knudfl 06-22-2013 02:44 PM

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

-

unSpawn 06-22-2013 02:57 PM

Quote:

Originally Posted by sayhello_to_the_world (Post 4976631)
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.

sayhello_to_the_world 06-22-2013 04:02 PM

hi there good day knudfl - and hello unSpawn


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

Quote:

Originally Posted by knudfl (Post 4976729)
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?


All times are GMT -5. The time now is 11:56 AM.