in reply to comparison of character
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 = <>); } [download]