And, for goodness' sake, use warnings;. This would have shown you that you incremented past the end of your @correct array (the first index of an array in perl is 0, not 1). I added these print statements to show the problem:
print "guess=$guess=\n"; print "correct[$i]=$correct[$i]=\n"; if ($guess eq $correct[$i]) { # if guess is correct, reply print "You Rock!\n"; $i++;
In reply to Re^3: Control Structure problem, mistake can't be found
by toolic
in thread Control Structure problem, mistake can't be found
by koolgirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |