Last active
August 29, 2015 13:57
-
-
Save sugyan/9366440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Find; | |
use File::Spec; | |
my %modules = (); | |
for my $path (grep { $_ ne '.' } @INC) { | |
find(+{ | |
wanted => sub { | |
my $name = $File::Find::fullname; | |
return unless length($name) > length($path); | |
return unless index($name, $path) == 0; | |
return unless $name =~ s/\.(?:pm|pod)\z//; | |
$name = substr $name, length($path); | |
my @dirs = grep { ! /\W/ } File::Spec->splitdir($name); | |
my $module = join('::', @dirs[1 .. $#dirs]); | |
$modules{$module}++ if $module; | |
}, | |
follow => 1, | |
follow_skip => 2, | |
}, $path); | |
} | |
print "$_\n" for sort keys %modules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use CPAN; | |
my @results = (); | |
for my $module ($CPAN::META->all_objects('CPAN::Module')) { | |
push @results, $module->id if $module->inst_version; | |
} | |
print join "\n", sort @results; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment