in reply to Bug in substitution operator?
Just disambiguate the $1 with braces as well: ${1}:
#!/usr/bin/perl use strict; use warnings; my @lines = split /\n/, <<'END'; begin{verbatim} hello all end{verbatim} END s{((?:begin|end)){verbatim}}{${1}{whatever}} for @lines; print "$_\n" for @lines; __END__ begin{whatever} hello all end{whatever}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Bug in substitution operator?
by polettix (Vicar) on Jan 10, 2009 at 20:53 UTC | |
by rhesa (Vicar) on Jan 10, 2009 at 21:09 UTC | |
by polettix (Vicar) on Jan 10, 2009 at 23:10 UTC |
In Section
Seekers of Perl Wisdom