in reply to Re^4: Adding a numeric key to list items and creating a user selection list
in thread Adding a numeric key to list items and creating a user selection list

Quick fix: chomp your input.

Proper fix: Restore the validation steps from my previous answer.

  • Comment on Re^5: Adding a numeric key to list items and creating a user selection list

Replies are listed 'Best First'.
Re^6: Adding a numeric key to list items and creating a user selection list
by stevek1974 (Novice) on Sep 26, 2015 at 16:28 UTC

    Works like a champ! Now, on to validation. Thanks again!

Re^6: Adding a numeric key to list items and creating a user selection list
by stevek1974 (Novice) on Sep 28, 2015 at 22:21 UTC

    Update

    Resolved

    Maybe not the best solution but I changed the check to...

    foreach my $i (@vdblist){ if ($i == 0){ print BOLD WHITE ON_RED, "Error: $i does not correspond to a h +ost in the list!", RESET; print "\n\n"; goto CLUSTER_HOSTS; } elsif ($i > scalar $#vdbhosts){ print BOLD WHITE ON_RED, "Error: $i does not correspond to a h +ost in the list!", RESET; print "\n\n"; goto CLUSTER_HOSTS; } }

    Now it works!