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
In reply to Re: regex/extracting whole lines
by CubicSpline
in thread regex/extracting whole lines
by kelleher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |