in reply to Re: (tye)Re: Elegant way to parse an optional prefix with default?
in thread Elegant way to parse an optional prefix with default?
Whether to treat $ and @ as literals or not inside a regular expression is the single most complicated case of DWIM in Perl. It calculates weights to make this decision. I hate that it results in /[$]/ being a syntax error.
And it is good that character classes are not exempted as $anagram !~ /[^\Q$word\E]/ is actually useful code.
Yes, if you turn on warnings you'll get "Use of uninitialized value in pattern match (m//)".
- tye
|
|---|