chomp needed.
I wouldn't necessarily call
simpler thanchomp( my $word = lc $_ ); if $word eq 'y' or $word eq 'yes';
if /^y(?:es)?$/i;
Maybe it's more complex to write, but surely it's simpler to read.
In reply to Re^2: conditional regex
by ikegami
in thread conditional regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |