In progress: auto-selection of CPAN mirrors

Lately, I've been working improving the user experience, particularly with regards to configuration. I've already made autoconfiguration quieter, and now I'm working on letting it automatically choose mirrors for you. Here's sample output from my work in progress:

cpan[3]> o conf init urllist

Now you need to choose your CPAN mirror sites.  You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.

Would you like me to automatically choose the best CPAN mirror
sites for you? (This means connecting to the Internet and could
take a couple minutes) [yes] 

Searching for the best CPAN mirrors (please be patient) ............................................................................................................. done!

New urllist

commit: wrote '/home/david/.cpan/CPAN/'

When I'm done, I hope that a novice Perl programmer can be downloading from CPAN within a couple minutes of running the CPAN client for the first time.

This entry was posted in cpan, perl programming, toolchain and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.


  1. CPAN User
    Posted November 7, 2009 at 11:33 pm | Permalink

    What is wrong with the redirector that automatically sends you to a geographically close mirror?

    • dagolden
      Posted November 8, 2009 at 6:09 am | Permalink

      Geographically close doesn't always mean close in terms of network speed. And while the auto-selection at the moment just uses ping times, I'd like to expand it to include both throughput and mirror freshness. gives you no control and no ability to avoid a bad mirror that you frequently get redirected to. This sets some good defaults and then gives control back to you.

  2. Posted November 8, 2009 at 6:09 am | Permalink

    That is awesome. That is a very tedious process and to have it automated is great.

  3. moltar
    Posted November 8, 2009 at 12:04 pm | Permalink

    Just googled "best cpan mirrors", because the list is simply too long and I don't know which ones are best off the top of my head. I think what you are doing is a great idea. I am sure you thinking of this, but just in case I want to mention, I think it's important to consider mirror update frequency as well. Some mirrors are slow at updating.

  4. jitendra singh tomar
    Posted May 1, 2012 at 2:31 am | Permalink

    Searching for the best CPAN mirrors (please be patient) ...................

    It takes too much time to configure. Is there any way to skip this or configuring limited number number of mirrors.

    • Posted May 1, 2012 at 11:06 am | Permalink

      If you say "no" to automatic configuration, then you can just pick from a list or manually enter one. I'm not sure if that will be much faster in the end.

© 2009-2014 David Golden All Rights Reserved