You are almost there.
- Remove the double quotes in the regular expression. They have no special meaning, so Perl tries to search for double quotes in the string - but there are none.
- ? has a special meaning in a regex. To be able to match it literally, you have to escape it. To escape the content of a variable, use the \Q.
- Your code as shown doesn't compile. There are some misnamed variables.
Here is the fixed version:
#!/usr/bin/perl
use warnings;
use strict;
my $a = "aRep";
my $b = "bRep";
my $c = "cRep";
my @Search = ("?a?", "?b?", "?c?");
my @Replace = ($a, $b, $c);
my $string = '?a? ?b? ?c?';
print "old string: $string\n";
for (my $i = 0; $i < $#Search + 1; $i++) {
$string =~ s/\Q$Search[$i]/$Replace[$i]/g;
}
print "new string: $string\n"