in reply to Another (maybe stupid) regex question ...
$text1 = quotemeta( $text1 ); $text2 =~ s/($text1)/FOO$1BAR/; [download]
--tidiness is the memory loss of environmental mnemonics