- or download this
my $text = "Here is some text.";
my $insert = "boring ";
$text =~ s/(some\s)/$1$insert/;
- or download this
my $text = "Here is some\nmulti-lined text";
my $insert = "thrilling "
$text =~ s/(some\s)/$1$insert/s;
- or download this
$text =~ s/(some\s)/$1$insert/sg;
- or download this
my $pattern = "Text with\nnewlines in it";
my $text = ......lots of stuff.....
$text =~ s/(\Q$pattern\E)/$1$insert/sg;