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).
In reply to Re^4: CPAN doesn't understand continents
by Anonyrnous Monk
in thread CPAN doesn't understand continents
by bluethundr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |