in reply to conversion between numbers and strings?
Your problem is that when things are read from STDIN, it includes the trailing newline, so that if you type quit, $guess ends up being "quit\n" which is, of course, not equal to "quit". The number comparison's work fine, because when it converts to a number any trailing non numerical characters are basically ignored. Just chomp $guess; before doing your comparisons
|
|---|