I have a case where I'm taking user input and feeding it to perl code in the following format:
$str =~ s/$match/$repl/;
where $str, $match, and $repl are strings fed to me by my user. Ignoring the security implications of this (I know there are plenty), I cannot get perl to recognize "\1" or "$1" sequences in the $repl variable.
For example, if $str contains "abc", $match contains "(a)(.)", and $repl contains "\2\1", $str ends up containing "\2\1c" instead of "bac", as intended.
Is there any way to force s/// to process this like I want?