in reply to User input check 'Do until' loop

As others have pointed out, this won't work:

if ($response eq 'yes' || 'Yes' || 'YES' || 'y')

... and they've pointed out some ways of fixing it. In the spirit of TIMTOWTDI (there's more that one way to do it), I'll suggest the smart match operator, which is available from Perl 5.10.

if ($response ~~ ['yes', 'Yes', 'YES', 'y'])

If you factor out the case-sensitivity by forcing $response to lower case, then it starts looking a little nicer:

if (lc $response ~~ ['yes', 'y'])

If you factor out the case-sensitivity by forcing $response to lower case, then it starts looking a little nicer:

if (lc $response ~~ ['yes', 'y'])

And some people would probably prefer the qw() operator (which builds an array by splitting a string on whitespace):

if (lc $response ~~ [qw(yes y)])
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'