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

hello monks,

I am attempting to configure cpan on this box.. I have actually seen this problem in several places on the net with no solution mentioned.
When I try to setup cpan it gets to the point of asking what continents you are on/near.
Then you make your choice and it keeps looping claiming that you've entered an invalid item:
First, pick a nearby continent and country (you can pick several of each, separated by spaces, or none if you just want to keep your existing selections). Then, you will be presented with a list of URLs of CPAN mirrors in the countries you selected, along with previously selected URLs. Select some of those URLs, or just keep the old list. Finally, you will be prompted for any extra URLs -- file:, ftp:, or http: -- that host a CPAN mirror. Select your continent (or several nearby continents) [] 5 invalid items entered, try again Select your continent (or several nearby continents) [] 5 invalid items entered, try again Select your continent (or several nearby continents) [] 6 invalid items entered, try again Select your continent (or several nearby continents) [] 7 invalid items entered, try again Select your continent (or several nearby continents) []


even tho all I am doing is entering in the continent numbers as I have in the past it still fails. can someone share how to get things past this point? thanks!

Replies are listed 'Best First'.
Re: CPAN doesn't understand continents
by Anonyrnous Monk (Hermit) on Jan 20, 2011 at 20:22 UTC

    If you enter a non-number, it should tell you the range of numbers it thinks is acceptable1. So, that might help to narrow down on what the problem is.

    ___

    1 the respective code snippet is (CPAN/FirstTime.pm — update: CPAN v1.94_56):

    my $num = prompt($prompt,$default); @nums = split (' ', $num); { my %seen; @nums = grep { !$seen{$_}++ } @nums; } my $i = scalar @$items; unrangify(\@nums); if (0 == @nums) { # cannot allow nothing because nothing means paging! # return; } elsif (grep (/\D/ || $_ < 1 || $_ > $i, @nums)) { $CPAN::Frontend->mywarn("invalid items entered, try again\ +n"); if ("@nums" =~ /\D/) { $CPAN::Frontend->mywarn("(we are expecting only number +s between 1 and $i)\n"); } next SELECTION; }
Re: CPAN doesn't understand continents
by Anonymous Monk on Jan 21, 2011 at 02:44 UTC
Re: CPAN doesn't understand continents
by Anonymous Monk on Jan 20, 2011 at 21:39 UTC
    I'm having the same problem. Unfortunately, entering a non-number doesn't help. CPAN is acting like it doesn't know about continents anymore.
    Select your continent (or several nearby continents) [] A invalid items entered, try again Select your continent (or several nearby continents) [] * invalid items entered, try again Select your continent (or several nearby continents) [] Sorry! since you don't have any existing picks, you must make a geographic selection. Select your continent (or several nearby continents) [] 1 invalid items entered, try again

      What version of CPAN/Perl do you have?  (The code shown above belongs to what ships with Perl 5.12.2 — older versions had rather different code...)

      Update: just checked that the CPAN which shipped with Perl 5.10.1 (v1.9402) looked very much the same, so yours must be older.  For example, with Perl 5.8.8, the respective code read just:

      @nums = split (' ', $num); my $i = scalar @$items; (warn "invalid items entered, try again\n"), next if grep (/\D/ || $_ < 1 || $_ > $i, @nums);

        No help from me, but I am having the exact same problem . Nothing works ( 5 "North America" "NA" "US" ... ) . Something must have broken recently . I remember using CPAN a couple of years ago and it worked ( tedious , but it worked ) .

        Would someone suggest a fix for this or suggest another way to install DBD::Oracle ?

        [root@hoqaweb1 ~]# cpan -v cpan script version 1.03 CPAN.pm version 1.7602 [root@hoqaweb1 ~]#
      Same problem here, just tried to initialize CPAN on two different systems, 1) A Macintosh running OS 10.5.8, and a CentOS 5.5 box. Both have not used CPAN yet on them, I get the identical errors on both of these systems. On the Mac I get this before the error.
      Your ftp_proxy? Your http_proxy? Your no_proxy? You have no /Users/adam/.cpan/sources/MIRRORED.BY I'm trying to fetch one CPAN: LWP::UserAgent loaded ok Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
      On the CentOS box I get this (slightly diff tool used to download the MIRRORED.BY list)
      Your ftp_proxy? Your http_proxy? Your no_proxy? You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one LWP not available CPAN: Net::FTP loaded ok Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
      Which obviously makes it seem that the problem is with the downloaded MIRRORED.BY file.