in reply to How to add perl variable before any text in perl code
And do, please, consider giving your eyes and sanity a huge break by thinking about using balanced delimiters — and maybe even some whitespace:
See perlre and perlretut, and m// s/// qr// qq// etc. in perlop.c:\@Work\Perl\monks>perl -wMstrict -le "my $xxx = 'YYY'; ;; my $boxtxt = 'aaa</boxed-text>bbb'; print qq{'$boxtxt'}; ;; $boxtxt =~ s{ </boxed-text> } {</new-stuff xxx${xxx}xxx>}xmsg; print qq{'$boxtxt'}; " 'aaa</boxed-text>bbb' 'aaa</new-stuff xxxYYYxxx>bbb'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to add perl variable before any text in perl code
by marto (Cardinal) on Dec 10, 2014 at 17:33 UTC | |
|
Re^2: How to add perl variable before any text in perl code
by ww (Archbishop) on Dec 10, 2014 at 17:29 UTC |