in reply to Re^4: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/ (updated)
in thread Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/
which isn't trivial within strings/regexes.
the "@{[...]}" trick works but is IMHO a bit oversized for this task.
DB<109> use constant STR => 1..3 DB<110> qr/[@{[ STR ]}]/ => qr/[1 2 3]/
thats not interpolation anymore but inline eval.
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/
by AnomalousMonk (Archbishop) on Apr 30, 2014 at 11:07 UTC |