Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

List of all perl modules existing on my machine

by suresh (Initiate)
on Nov 06, 2002 at 16:25 UTC ( [id://210784]=perlquestion: print w/replies, xml ) Need Help??

suresh has asked for the wisdom of the Perl Monks concerning the following question:

Is there any command in perl to list out all the modules I installed on my machine ( UNIX ) ? Thanks In Advance
  • Comment on List of all perl modules existing on my machine

Replies are listed 'Best First'.
(jeffa) Re: List of all perl modules existing on my machine
by jeffa (Bishop) on Nov 06, 2002 at 16:38 UTC
    If you have a web server on your machine, check out hacker's MoDetails v0.2. Here is the relevant code if you don't have a web server or just want to see the output via command line:
    use strict; use ExtUtils::Installed; my $inst = ExtUtils::Installed->new(); print $_,$/ for $inst->modules();

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: List of all perl modules existing on my machine
by joe++ (Friar) on Nov 06, 2002 at 16:29 UTC
    Hi suresh,

    $ perldoc perllocal will give you all the modules that were installed through the standard procedure:

    perl Makefile.pl make make test # ;-) make install # this updates perllocal.pod
    But you will miss the "standard" mods that come with Perl.

    (Update: fixed stupid typo in user node number)

    --
    Cheers, Joe

      Thanks Joe!!!
Re: List of all perl modules existing on my machine
by ehdonhon (Curate) on Nov 06, 2002 at 17:34 UTC

    I have this code snippit in my archive of useful stuff. It originated from somebody else's post on perlmonks, but I'm not sure who.

    !#/usr/local/bin/perl use CPAN; for my $mod (CPAN::Shell->expand("Module","/./")){ next unless $mod->inst_file; print $mod->id, '(', $mod->inst_version, ') '; unless($mod->uptodate()) { print "\t\t#( V. ",$mod->cpan_version, " available on CPAN +)"; } print "\n"; }
Re: List of all perl modules existing on my machine
by dash2 (Hermit) on Nov 06, 2002 at 17:40 UTC
    I seem to recall a product called "perldiver" which does this. Aimed at the end user and possibly non-free - and for all I know, incredibly insecure etc. - but take a look.

    dave hj~

Re: List of all perl modules existing on my machine
by robartes (Priest) on Nov 07, 2002 at 11:07 UTC
    This is not exactly what you asked (it's not Perl), but here's a piece of shell abuse that does it the hard way:
    for path in `perl -e 'print join "\n", @INC'`; do find $path -name "*.pm"|perl -pe "s|$path/||;s|/|::|g;s/\.pm$//;" done |uniq

    CU
    Robartes- demonstrating that a combination of shell and Perl can be even gnarlier that either one alone :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://210784]
Approved by joe++
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found