in reply to Control Structure problem, mistake can't be found
After you set $guess (whether you read it from STDIN or not), but before the line
you can see what the value of $guess is by doingif ($guess eq $correct[$i])
Note the square brackets ( [ and ] ). They are important here because they show where the value starts and ends. So if the value of $guess is Yellow\n, you getprint "[$guess]";
and you see clearly that you have a \n at the end (which you may not want).[Yellow ]
|
|---|