in reply to String Replace

The question mark has a special meaning in regexes, see perlreintro for details.

To rob it off its special meaning, you can do

$proc_string =~ s/\Q$temp1\E/$temp2/g;