$replace = '$1 thirdword'; ($varsub = $string) =~ s/$search/$replace/;
Should be replaced with...
$replace = '$1 . " thirdword"'; ($varsub = $string) =~ s/$search/$replace/ee;
...at least that is if you are looking for a solution that is pretty close to what you're attempting.
Dave
In reply to Re: Regexp variable substitution of special variable
by davido
in thread Regexp variable substitution of special variable
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |