Help for this page

Select Code to Download


  1. or download this
    my @vdbhosts = sort @lines;
    foreach my $i (0..$#vdbhosts) {
        print " " . $i + 1 . ". $vdbhosts[$i]\n";
    }
    print "\n";
    
  2. or download this
    my ($userinput) = (<> =~ /([0-9]+)/g);
    die "User did not input a number" unless defined $userinput;
    die "User's number ($userinput) is out of range" unless (0 < $userinpu
    +t and $#vdbhosts >= $userinput - 1);
    print "Your choice was number $userinput which is " . $vdbhosts[$useri
    +nput - 1] . "\n";