$string = "fooar" $string =~ s/$_/b/g for (qr/foo/, qr/bar/); $print $string;