Sophie

Sophie

distrib > Mageia > 3 > i586 > by-pkgid > b7beaeca579deb75b13c8eff27b3c7b3 > files > 11

perl-CPAN-Dependency-0.160.0-2.mga3.noarch.rpm

#!/usr/bin/perl
use strict;
use CPAN::Dependency;

my $file = shift || 'cpants.db';

my $cpandep = new CPAN::Dependency;
print "loading $file...\n";
$cpandep->load_cpants_db(file => $file);
print "calculating score...\n";
$cpandep->calculate_score;
print "saving YAML file...\n";
$cpandep->save_deps_tree(file => 'deps.yml');

my %score = $cpandep->score_by_dists;
my @dists = sort { $score{$b} <=> $score{$a} } keys %score;
print "Top 10 modules\n";
for my $dist (@dists[0..9]) {
    printf "%5d %s\n", $score{$dist}, $dist;
}