If the expected input is y or yes in a line then following code can be used simply.
while(<>) { print "yes\n" if /(^y$|^yes$)/i; }
In reply to Re^2: conditional regex
by gobisankar
in thread conditional regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |