Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: comparison of character

by roboticus (Canon)
on Jul 16, 2013 at 11:14 UTC ( #1044553=note: print w/ replies, xml ) Need Help??


in reply to comparison of character

Think about it a bit more: If the user enters 'X', it enters the while loop because 'X' ne 'Y', right?

If the user enters 'Y' then the first bit of your conditional fails ('Y' eq 'Y') so it continues to the next bit--but 'Y' ne 'y' so the conditional is satisfied anyway.

Any character you enter will satisfy one of the parts of your while condition. I suggest you think about your logic AND change the conditional to make it do what you want. ;^)

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re: comparison of character

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-08-23 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (168 votes), past polls