Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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.

Replies are listed 'Best First'.
(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 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 merlyn (Sage) on Jul 01, 2002 at 13:43 UTC
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.


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.

    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.

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 in @INC (@INC contains: blah blah blah
    Then it is not installed.



      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.


      #!/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);'
Re: Find Perl Modules Installed.
by smitz (Chaplain) on Jul 01, 2002 at 15:06 UTC
      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2023-10-02 19:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found