Created
March 14, 2010 10:13
-
-
Save xaicron/331904 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ExtUtils::MakeMaker; | |
| use Config; | |
| use File::Find; | |
| my $max = 0; | |
| my $data = +{}; | |
| for my $lib (@INC) { | |
| next if $lib eq '.'; | |
| next unless -d $lib; | |
| $lib =~ s|\\|/|g; | |
| find sub { | |
| if ($_ =~ /\.pm$/) { | |
| my $path = $File::Find::name; | |
| my $version = MM->parse_version($path) || ''; | |
| (my $module = $path) =~ s|$lib/||; | |
| $module =~ s|\.pm$||; | |
| $module =~ s|$Config{archname}/?||o; | |
| $module =~ s|/|::|g; | |
| $max = length $module < $max ? $max : length $module; | |
| $data->{$module} ||= "$version"; | |
| } | |
| }, $lib; | |
| } | |
| for my $module (sort keys %$data) { | |
| printf "%-*s : %s\n", $max, $module, $data->{$module}; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment