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

Hi, Perl monks!

Is there a way to determine:

Thanks for any & all information. You guys rock!

Replies are listed 'Best First'.
Re: what modules are present?
by jettero (Monsignor) on Jul 17, 2007 at 15:46 UTC

    I think you can look up part two in Module::CoreList... part one follows (I have this in a file called "pm" and run it fairly frequently).

    use strict; use ExtUtils::Installed; my $inst = new ExtUtils::Installed; my @mods = $inst->modules; my $max = 0; for (@mods) { $max = length $_ if length $_ > $max } open OUT, "|less" or die $!; for my $m (@mods) { print OUT sprintf('%-*s', $max, $m), ' v', $inst->version($m), "\n +"; } close OUT;

    -Paul

Re: what modules are present?
by ikegami (Patriarch) on Jul 17, 2007 at 15:52 UTC

    First of all, your first question has come up on SoPW before. You could try doing a Super Search to find the answer.

    If you used a tool like ppm or cpan to install your modules, they might be able to tell you which modules they installed.

    You might be interested in Module::CoreList. It lists which modules are part of each version of Perl. Your distribution could have come with more than those modules, though. For example, ActivePerl includes libwin32, a library of Win32 modules.

Re: what modules are present?
by wind (Priest) on Jul 17, 2007 at 17:01 UTC
Re: what modules are present?
by thezip (Vicar) on Jul 17, 2007 at 18:47 UTC

    From the command line, I use:

    perldoc perllocal

    to discover which modules have been installed.

    This not only tells you which version is installed, but also when it was installed.


    Where do you want *them* to go today?
Re: what modules are present?
by sago (Scribe) on Jul 18, 2007 at 09:45 UTC

    Try the below code...it will list the modules installed in your machine.

    #!/usr/local/bin/perl

    use ExtUtils::Installed;

    my $instmod = ExtUtils::Installed->new();
    foreach my $module ($instmod->modules()) {
    my $version = $instmod->version($module) || "???";
    print "$module -- $version\n";
    }