in reply to Re: CPAN doesn't understand continents
in thread CPAN doesn't understand continents

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);

Replies are listed 'Best First'.
Re^3: CPAN doesn't understand continents
by mochaman69 (Initiate) on Jan 20, 2011 at 23:02 UTC

    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 ~]#

      To debug the issue, I would print out @nums and @$items  (i.e. modify CPAN/FirstTime.pm1).  Then you'll know which direction to look further.

      Maybe there's some non-whitespace junk char in $num ... e.g.:

      use Data::Dumper; $Data::Dumper::Useqq=1; my $items = [ qw(foo bar baz) ]; my $num = "1 2\0"; @nums = split (' ', $num); print Dumper @nums; my $i = scalar @$items; (warn "invalid items entered, try again\n") if grep (/\D/ || $_ < 1 || $_ > $i, @nums); __END__ $ ./picklist-test.pl $VAR1 = 1; $VAR2 = "2\0"; invalid items entered, try again

      Or @$items has not enough elements (or is empty)...  There isn't really a lot that could go wrong in the test.

      ___

      1 If you don't know where it is,  perl -MCPAN::FirstTime -le 'print $INC{q(CPAN/FirstTime.pm)}' will tell you (use double quotes on Windows).