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.

I recommend that you use a module to prompt. Under ActiveState, use ActiveState::Prompt. It has a function called 'yes' whic does what you want. On other platforms, use IO::Prompt::Hooked. The documentation uses your case as an example of prompt with validation.