http://www.perlmonks.org?node_id=868212


in reply to Listing all of the perl modules installed

You could try using the ExtUtils::Installed and Module::CoreList modules. Here is an example that finds all modules and displays the version numbers of each:

#!perl use strict; use warnings; use feature qw(:5.12); use ExtUtils::Installed; use Module::CoreList; use Module::Info; my $inst = ExtUtils::Installed->new(); my $count = 0; my %modules; foreach ( $inst->modules() ) { next if m/^[[:lower:]]/; # skip pragmas next if $_ eq 'Perl'; # core modules aren't present in this +list, # instead coming under the name Perl my $version = $inst->version($_); $version = $version->stringify if ref $version; # version may be r +eturned as # a version object $modules{$_} = { name => $_, version => $version }; $count++; } foreach ( Module::CoreList->find_modules() ) { next if m/^[[:lower:]]/; # skip pragmas my $module = Module::Info->new_from_module($_) or next; $modules{$_} = { name => $_, version => $module->version // q(???) + }; $count++; } foreach ( sort keys %modules ) { say "$_ v$modules{$_}{version}"; } say "\nModules: $count"; __END__

Update: Links fixed.