Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Installed Module

by Anonymous Monk
on Apr 12, 2005 at 06:36 UTC ( [id://446869]=perlquestion: print w/replies, xml ) Need Help??

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

Dear Monks,

How we find that what are all the modules installed in my system.

Thanks

Replies are listed 'Best First'.
Re: Installed Module
by lidden (Curate) on Apr 12, 2005 at 07:07 UTC
    From "perldoc perlmodlib":
    To find out all modules installed on your system, including those with +out documentation or outside the standard release, just use the following command (under the default win32 shell, double qu +otes should be used instead of single quotes). % perl -MFile::Find=find -MFile::Spec::Functions -Tlwe \ 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
      ++ one liner, ++ clever use of File::Find. You gotta love perldoc.

      -Jim

Re: Installed Module
by borisz (Canon) on Apr 12, 2005 at 07:15 UTC
    use ExtUtils::Installed; use List::Util qw/max/; my $inst = ExtUtils::Installed->new; my %h = map { ( $_, $inst->version($_) || 'undef' ) } $inst->modules; my $max = max map length, keys %h ; for ( sort keys %h ) { printf "%-${max}s %s\n", $_, $h{$_}; }
    Boris
Re: Installed Module
by monkfan (Curate) on Apr 12, 2005 at 07:00 UTC
    Anything here suits you?
    $ perl -MModule::Name -e 'print "it is installed\n";' $ perl -MModule::Name -e1 $ perldoc -l Module::Name $ locate *.pm
    Regards,
    Edward
      I can't locate Module::Name either on www.cpan.org or using Google.
      A URL pointing to it would be most appreciated.
      You can lead {some|many|most} to knowledge, but a few will steadfastly refuse to think (for themsleves). Clue Repellant!

        "Module::Name" is not a real module but a placeholder for one that is. Replace "Module::Name" with the name of any real module from CPAN.

Re: Installed Module
by cog (Parson) on Apr 12, 2005 at 09:37 UTC
Re: Installed Module
by DaWolf (Curate) on Apr 12, 2005 at 13:50 UTC
    Just my win32-two-cents:

    If you are using ActiveState's ActivePerl it comes with a program called ppm. Once inside ppm you have to type:

    ppm> query *

    Best regards,
Re: Installed Module
by borisz (Canon) on Apr 12, 2005 at 07:17 UTC
Re: Installed Module
by davidrw (Prior) on Apr 12, 2005 at 19:06 UTC
    This will list what you have installed, including your version number and the lastest & greatest available version number. (This may only include what's been installed via the cpan command/module, but i'm not sure--the version comparison if definitely nice though)
    /usr/bin/perl -MCPAN -e 'CPAN::Shell->r;'
      Unfortunately that only lists the modules where there is a later version available on CPAN. Therefore if you have the latest version of all modules installed it lists nothing.
        ah. yup, you're right. Ok, i'll actually read the doc :) From man CPAN, there is:
        # list all modules on my disk that have newer versions on C +PAN for $mod (CPAN::Shell->expand("Module","/./")){ next unless $mod->inst_file; next if $mod->uptodate; printf "Module %s is installed as %s, could be updated to + %s from CPAN\n", $mod->id, $mod->inst_version, $mod->cpan_v +ersion; }
        Commenting out the "next if $mod->uptodate;" produces code that shows installed modules, version, and cpan version. one-line-ified:
        perl -MCPAN -e 'for $m (CPAN::Shell->expand("Module","/./")){printf "% +s %s (%s)\n",$m->id,$m->inst_version,$m->cpan_version if $m->inst_fil +e}'
Re: Installed Module
by jacques (Priest) on Apr 13, 2005 at 00:37 UTC
    use HTML::Perlinfo; perlinfo(INFO_MODULES);

    That will show you all the modules on your system, their version number, their location, and whether or not they are core. It will also provide you with an html link to their documentation on CPAN. 'nough said.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://446869]
Approved by Corion
Front-paged by monkfan
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found