use strict; use warnings; use File::Find; my $outfile = 'installed_mods.txt'; open( OUTFILE, '>', $outfile ) or die "error opening $outfile: $!\n"; 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 OUTFILE "$fullPath\n"; } #### use strict; use warnings; use Module::Info; my @mods = Module::Info->all_installed( 'Bit::Vector' ); foreach my $mod ( @mods ) { print join( "\n ", $mod->name, $mod->version, $mod->inc_dir, $mod->file, $mod->is_core ); }