Perl Monk, Perl Meditation | |
PerlMonks |
Re: binding operatorby Fletch (Bishop) |
on Jul 21, 2020 at 15:52 UTC ( [id://11119609]=note: print w/replies, xml ) | Need Help?? |
Well for one thing your first version is assigning the result of comparing qr/(a|b|x)/i against $_ back into $_. Harmless in this case, but . . . For another, your second chunk is attempting to match the regex qr{ /(a|b|x)/} against $teststring which isn't what you mean either. When you use the match operator with different delimiters you don't need the extra slashes (e.g. you really meant if( $teststring =~ m{(a|b|x)}i ) {...} there).
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|