#!/usr/bin/perl -w use strict; my $str = "pencil pen marker highlighter pencil pen "; my $insert = "crayon\n"; while ($str =~ /pencil\npen\n/mg) { my $pos = pos($str); substr($str,$pos,0) = $insert; pos($str) = $pos+length($insert); } print $str;
In reply to Re: multi line text insert
by sgifford
in thread multi line text insert
by tablet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |