Keep It Simple, Stupid | |
PerlMonks |
Re: Perl treats period as space in stringby perlfan (Vicar) |
on Jul 20, 2021 at 22:07 UTC ( [id://11135238]=note: print w/replies, xml ) | Need Help?? |
It's confusing to define the regexp in a variable, then place it there between the /../; The reason is that in the assignment it's very much just a string. When you place it in the regexp context, it suddenly means something different (i.e., the "dot"). So don't do that unless it's very cleary you're dynamically defining your regular expression, otherwise you're just making it more confusing for you and anyone else who may be looking at this even in the very near future.
In Section
Seekers of Perl Wisdom
|
|