I am trying to do a substitution using RE but it is not yielding correct results
my initial_string is: $initial_string = "REPLACE";
my replace_with string is: $replace_with_string = '\\decs17\dq';
When I do:
$initial_string =~ s{REPLACE}{$replace_with_string};It gives me initial_string as \decs17\dq Note that the double back slash is missing. When I do: $initial_string =~ s{REPLACE}{\Q$replace_with_string\E}; It makes more mess by making intial_string as \\decs17\\dq
What should I use with the substitution. Help is appreciated.!!