Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Money spines organ fun

  • Loading branch information...
commit 47c5fe44331a1493b73a3fa88e9cddfe3421e65e 1 parent 8da1587
Chris Williams authored
Showing with 62 additions and 0 deletions.
  1. +40 −0 analyselevels.pl
  2. +22 −0 findperls.pl
40 analyselevels.pl
View
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+use File::Spec;
+use File::Spec::Unix;
+use File::Fetch;
+use IO::Zlib;
+use version;
+use Module::Load::Conditional qw[check_install];
+
+my $mirror = 'http://cpan.hexten.net/';
+
+my $loc = fetch_indexes('.',$mirror) or die;
+
+my $fh = IO::Zlib->new( $loc, "rb" ) or die "$!\n";
+
+my %counts;
+
+while (<$fh>) {
+ last if /^\s*$/;
+}
+while (<$fh>) {
+ chomp;
+ my ($module,$version,$package_path) = split ' ', $_;
+ my $count = split /::/, $module;
+ push @{ $counts{ $count } }, $module;
+}
+
+print "$_,", join(',', sort @{ $counts{$_} } ), "\n" for sort { scalar @{ $counts{$b} } <=> scalar @{ $counts{$a} } } keys %counts;
+exit 0;
+
+sub fetch_indexes {
+ my ($location,$mirror) = @_;
+ my $packages = 'modules/02packages.details.txt.gz';
+ my $url = join '', $mirror, $packages;
+ my $ff = File::Fetch->new( uri => $url );
+ my $stat = $ff->fetch( to => $location );
+ return unless $stat;
+ warn "Downloaded '$url' to '$stat'\n";
+ return $stat;
+}
22 findperls.pl
View
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+use autodie;
+use File::Spec;
+use Module::CoreList;
+use Perl::Version;
+use Cwd;
+
+my $path = shift || '.';
+$path = Cwd::realpath($path);
+die "Not a directory\n" unless -d $path;
+
+print $path, "\n";
+
+opendir my $dir, $path;
+while (my $item = readdir $dir) {
+ next if $item =~ /^(\.|devel|maint|latest)/;
+ next if $item =~ /(RC|TRIAL)/;
+ next unless $item =~ /\.tar\.(gz|bz2)$/;
+ print $item, "\n";
+}
+closedir $dir;
Please sign in to comment.
Something went wrong with that request. Please try again.