McDuff has asked for the wisdom of the Perl Monks concerning the following question:

Before installing CPAN, I first traceroute'd the various mirrors listed to see which were the closest, and selected them.

Now, it seems that everytime I look for a module, either the mirrors are opaque (unavailable) or don't have the module.

  1. Am I doing something wrong?
  2. Where / how can I change the CPAN mirror sites on my machine to eliminate ones which are 'unhelpful'? (See output below)
  3. Is there a module on CPAN that looks up the current mirror sites and then tests them to see which ones are 'alive' and closest (traceroute) to me?

cpan> install Time::HiRes Fetching with LWP: ftp://mirrors.rcn.net/pub/lang/CPAN/authors/01mailrc.txt.gz LWP failed with code[400] message[FTP return code 425] Fetching with Net::FTP: ftp://mirrors.rcn.net/pub/lang/CPAN/authors/01mailrc.txt.gz Couldn't fetch 01mailrc.txt.gz from mirrors.rcn.net Fetching with LWP:.... Couldn't fetch 01mailrc.txt.gz from

Finally...success. Thanks.

Replies are listed 'Best First'.
Re: CPAN - Post Installation Modification & Mirror Sites
by TomDLux (Vicar) on Jul 04, 2003 at 18:08 UTC
    find /usr -name Config.pm -print

    You might try CPANPLUS (I haven't tried it, but the CPAN docs recommend it)

    --
    TTTATCGGTCGTTATATAGATGTTTGCA

      Even easier:

      $ perldoc -l CPAN::Config

      Of course, the o conf command within the CPAN shell may also help.

      Thanks. That did the trick.

      Now I know where to look for the CPAN config files:

      /usr/libdata/perl5/CPAN/Config.pm

Re: CPAN - Post Installation Modification & Mirror Sites
by bobn (Chaplain) on Jul 04, 2003 at 20:03 UTC
    find your CPAN/Config.pm and edit it to fix urllist:
    'urllist' => [ q[http://theoryx5.uwinnipeg.ca/pub/CPAN/], q[ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/], ],
    Somewhere there ought to be a list of these, I agree.

    Update: Some googling aroung found this:

    http://mirror.cpan.org/status.cgi , where you can search on your continent. lciking on a ntry that returns willl give http: and ftp: URLs that exist at that mirror. http: is simpler to use in a firewalled environment.



    --Bob Niederman, http://bob-n.com
Re: CPAN - Post Installation Modification & Mirror Sites
by Aighearach (Initiate) on Jul 05, 2003 at 10:11 UTC
    Number of hops is a terrible way of determining which mirrors to use. Here are some of the things I take into consideration:
    • Pipe size
    • Some servers, such as nasa's, have a really fat pipe. Even if it's a few extra hops, a server with a bigger network connection will often provide a happier, faster download experience.
    • Users allowed
    • When using FTP servers, there are some servers that are really fast, but quickly fill up. Such as orst.edu. Don't waste your time slurping from them unless you have a good reason to.
    • Protocol
    • My first choices are usually certain FTP servers, but my I always make sure to have a couple HTTP servers in at the end. Why? Because they're less likely to be "full" and not accepting users.
    • Lastly, location
    • I prefer to measure distance by ping latency instead of hops, it's a truer measure of internet distance. A parallel would be, if you're in a village on a main road, a city 200 miles away might be effectively closer than the village 20 miles away across roadless swamps.

    --
    Snazzy tagline here

      In many cases the performance of http and ftp will be equal, or at least indistinguishable.

      That being the case, and ftp having so many issue (allowed connection limits, firewals and active/passive mode interactions), I think most folks will actually be happier having the http URLs first.

      Of course, this assumes that whatever web proxies you're going through allow whatever user agent string that CPAN uses.

      Looking at the actual CPAN.pm file ($VERSION = '1.61'), there are 2 places where I see:

      $Ua = CPAN::LWP::UserAgent->new;

      Placing:

      $Ua->agent('some_string_the_firewall_likes');

      after the second such reference changed the UAS used for CPAN going out to a URL in the urllist. .



      --Bob Niederman, http://bob-n.com
        I've never heard of a Perl mirror, or really anything in the unix world, giving people trouble over agent strings. Actually I do a lot of my browsing with "Aighearach was here" as my agent string, without trouble.

        Do you have an example of a CPAN mirror or other Perl site that has a restriction of this sort?

        For the most part I do agree with you that HTTP is a better bet if you don't know what FTP servers are good. Personally, I just lean heavy on the NASA server, and use an HTTP as a backup.
        --
        Snazzy tagline here

Re: CPAN - Post Installation Modification & Mirror Sites
by sgifford (Prior) on Jul 04, 2003 at 18:39 UTC
    My system doesn't work with active FTP (misconfigured router I haven't fixed yet), and I get similar errors if I don't run with the environment variable FTP_PASSIVE set. It looks like the files LWP is trying to get are there; ncftp can get them from my box.

    It's also possible you're having network problems unrelated to CPAN. Can you FTP these files manually?

      It appears that some sites are very slow. Changing mirror addresses solved the problem. Thanks.