in reply to Disabling Variable Expansion in regular expressions.
use single quotes as delimiter ... it's magic!
DB<17> $a= "xxx" DB<18> p 'xxx' =~ m/$a/ 1 DB<19> p 'xxx' =~ m'$a' DB<20>
From perlre#The-Basics
> Most times, the pattern is evaluated in double-quotish context, but it is possible to choose delimiters to force single-quotish, like
$foo =~ m'abc'
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Disabling Variable Expansion in regular expressions. (single quotes as delimiters)
by LanX (Saint) on May 23, 2019 at 16:28 UTC | |
by Anonymous Monk on May 23, 2019 at 20:16 UTC | |
by Anonymous Monk on May 23, 2019 at 18:57 UTC |