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 choroba (Canon)
on Jul 16, 2013 at 11:16 UTC ( #1044555=note: print w/ replies, xml ) Need Help??


in reply to comparison of character

If you enter "Y", then $choice ne "N", so the OR clause is true and the while loop continues. You should have used && instead of ||.

Moreover, you can include the first reading of the input into the loop as well:

print "Do you wish to update (Y/N)?\n"; my $choice = q(); while ('y' ne lc $choice and 'n' ne lc $choice) { chomp($choice = <>); }
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


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://1044555]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (20)
As of 2015-07-07 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls