|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Reusing a complex regexp in multiple spots, escaping the regexpby ikegami (Patriarch) |
| on Apr 12, 2026 at 20:11 UTC ( [id://11167525]=note: print w/replies, xml ) | Need Help?? |
|
Use <<'PATTERNEND'. It doesn't allow/require escaping.
<<PATTERNEND, aka <<"PATTERNEND" uses the same quoting rules as double-quote literals, so you'd need to esacape characters that are special in double-quote literals, which includes \.
But qr// is better suited for regex patterns.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||