in reply to Another (maybe stupid) regex question ...

TIMTOWTDI: This is also an acceptable solution, which simply does the quoting outside the regex:
$text1 = quotemeta( $text1 ); $text2 =~ s/($text1)/FOO$1BAR/;

--tidiness is the memory loss of environmental mnemonics