in reply to multi line text insert
There are two basic ways to insert text into a string. The substr function is preferred if you know the offset where the new text is to go,
substr $_, $offset, 0, $added_text; # or substr( $_, $offset, 0) = <<EOT; Some text to add. EOT
The other way is with the substitution operator, s///. That is preferred when the insertion position is determined by context, i.e. by regex matching. To match across line ends, you may want to use the /s flag so that '.' is allowed to match "\n", and it sounds as if you want to do multiple matches, so the /g flag is also called for. s/$pattern/$new_text/sg; More detail about your pattern and the substitute text would allow better advice.
After Compline,
Zaxo
|
|---|