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'
| [reply] [d/l] |
|
++ one liner, ++ clever use of File::Find. You gotta love perldoc.
| [reply] |
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{$_};
}
| [reply] [d/l] |
Re: Installed Module
by monkfan (Curate) on Apr 12, 2005 at 07:00 UTC
|
$ perl -MModule::Name -e 'print "it is installed\n";'
$ perl -MModule::Name -e1
$ perldoc -l Module::Name
$ locate *.pm
| [reply] [d/l] |
|
| [reply] |
|
| [reply] |
Re: Installed Module
by cog (Parson) on Apr 12, 2005 at 09:37 UTC
|
| [reply] |
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,
| [reply] |
Re: Installed Module
by borisz (Canon) on Apr 12, 2005 at 07:17 UTC
|
perldoc perllocal
| [reply] [d/l] |
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;'
| [reply] [d/l] |
|
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.
| [reply] |
|
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}'
| [reply] [d/l] [select] |
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. | [reply] [d/l] |