Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Find Perl Modules Installed.

by prhodes (Novice)
on Jul 01, 2002 at 13:37 UTC ( #178544=perlquestion: print w/ replies, xml ) Need Help??
prhodes has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I'm trying to find an **easy** way to work out what modules are installed. perl -V gives a bunch of paths. I can see one particular modules (sybperl) located in one of those paths, but this is not particularly satisfactory. I need to generate a list of all the modules. Does anybody know how to do this. Thanks v. much in advance. Peter.

Comment on Find Perl Modules Installed.
•Re: Find Perl Modules Installed.
by merlyn (Sage) on Jul 01, 2002 at 13:43 UTC
(wil) Re: Find Perl Modules Installed.
by wil (Priest) on Jul 01, 2002 at 13:44 UTC
    This question has been asked and answered many times and is now available in many FAQ documents.

    Here is the FAQ answer you're looking for. You might also be interested in finding out which version of a paticular module you have installed.

    Hope this helps

    - wil
Re: Find Perl Modules Installed.
by broquaint (Abbot) on Jul 01, 2002 at 13:45 UTC
    If you type in 'perl modules installed' into the search box at the top of the page you will find a plethora of nodes on this very subject.
    HTH

    _________
    broquaint

Re: Find Perl Modules Installed.
by mikeirw (Pilgrim) on Jul 01, 2002 at 14:06 UTC

    Something that's been useful to me in the past is the pmtools suite from Tom Christiansen. I can't seem to find a working link to them, so I've uploaded the tarball to my server.

    http://ampa.pair.com/~mikeirw/pmtools-1.00.tar.gz

    The one that you'll want to check out is called 'pminst'.

      Does anyone have an updated location for pmtools? This post is 2 years old and the link is dead. Or has pmtools morphed into some other package that I can use to find installed pms?


      "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


      OSUnderdog
Re: Find Perl Modules Installed.
by dree (Monsignor) on Jul 01, 2002 at 15:00 UTC
    One way is to use ExtUtils::Installed
    use ExtUtils::Installed; my $inst = ExtUtils::Installed->new(); print join "\n", $inst->modules();
    for more informations: ExtUtils::Installed

    There is also a free CGI script from Scriptsolutions that shows you all the installed modules and other useful informations.

    The script (perldiver) is located here

Re: Find Perl Modules Installed.
by smitz (Chaplain) on Jul 01, 2002 at 15:06 UTC
        ppm>query * returns
        '*': invalid regular expression.
        And if your using ActivePerl chances are 99% of your modules were installed by PPM anyhow, no?

        SMiTZ
Re: Find Perl Modules Installed.
by flounder99 (Friar) on Jul 01, 2002 at 16:25 UTC
    Quick and Dirty answer
    perl -e 'use UnknownModule'
    if you get something like
    Can't locate UnknownModule.pm in @INC (@INC contains: blah blah blah
    Then it is not installed.

    --

    flounder

      Don't remember where I got this code, I can't take credit for writing it. I probably found it searching here, infact, I'm positive that I did.

      Uses File::Find, quite handy..

      I know its lame to not remember the author.

      Here:

      #!/usr/bin/perl # list all of the perl modules installed use File::Find ; for (@INC) { find(\&modules,$_) ; } sub modules { if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return } return unless /\.pm$/ ; my $fullPath = "$File::Find::dir/$_"; $fullPath =~ s!\.pm$!!; $fullPath =~ s#/(\w+)$#::$1# ; print "$fullPath \n"; }


      --~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--
      perl -e '$a="3567"; $b=hex($a); printf("%2X\n",$a);'
      --~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--~~--

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2014-12-18 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls