Your loop misses a body (with curly braces).
$choice ne "Y" || $choice ne "y"
if $choice is Y, then $choice ne 'y' is true, and the whole condition is true. Or more general, if one of the branches is false, all the other branches are true, and the condition as a whole is true again.
You probably want to use while ($choice !~ /[yn]/i) { ... }, or while (!($choice eq 'y' || $choice eq ...)) { }.
In reply to Re: comparison of character
by moritz
in thread comparison of character
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |