Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: comparison of character

by moritz (Cardinal)
on Jul 16, 2013 at 11:15 UTC ( #1044554=note: print w/ replies, xml ) Need Help??


in reply to comparison of character

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 ...)) { }.


Comment on Re: comparison of character
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-08-27 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (248 votes), past polls