Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Control Structure problem, mistake can't be foundby broomduster (Priest) |
on Aug 23, 2008 at 00:21 UTC ( [id://706348]=note: print w/replies, xml ) | Need Help?? |
One more tip for how to debug this kind of thing....
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 doing 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 get and you see clearly that you have a \n at the end (which you may not want).
In Section
Seekers of Perl Wisdom
|
|