in reply to Substitution with matching nested boundary conditions
$content =~ s{(foo.*?bar)}{ my $s = $1; $s =~ s{\Q$orig_zimzam\E}{$rep_zimzam}; $s; }sge; [download]
Dave.