The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use CPAN::Mirrors;
use Data::Dumper;

my $mirrors = CPAN::Mirrors->new;

my $mirrored_by_file = '/Volumes/Atlas/CPAN/MIRRORED.BY';
$mirrors->parse_mirrored_by( $mirrored_by_file );

my $seen = {};

my $best_continent = $mirrors->find_best_continents( { seen => $seen } );
my @mirrors        = $mirrors->get_mirrors_by_continents( $best_continent );

my $callback = sub { 
	my( $m ) = @_; 
	printf "%s = %s ms\n", $m->hostname, 1000 * $m->rtt 
	};
my @sorted_mirrors = $mirrors->get_mirrors_timings( \@mirrors, $seen, $callback );

print "Best mirrors are ", 
	join ' ', map( $_->hostname, @sorted_mirrors[0..3] ), 
	"\n";