in reply to matching lines in a long string

It also works like this:

for my $line ( split /^/, $s )