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
In reply to Re: conversion between numbers and strings?
by Koosemose
in thread conversion between numbers and strings?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |