SyntaxFix
Write A Post
Hire A Developer
Questions
I would suggest something like:
$text =~ m{(.*)$find(.*)}; $text = $1 . $replace . $2;
It is quite readable and seems to be safe. If multiple replace is needed, it is easy:
while ($text =~ m{(.*)$find(.*)}){ $text = $1 . $replace . $2; }