in reply to regex/extracting whole lines

Is something like this what you're after:
use strict; open IN, "filename" || die "Couldn't open file!"; my $line,$i; my $n = 5; #how many lines after the **line** to get my $emailtext = ""; while( chomp($line = <IN>) ) { #if line has ** in it, then get next n lines if( $line =~ /\*\*/) { for my $i (1..$n) { $emailtext .= <IN>; } #send your email here } }

HTH
~CS