in reply to Print area between two lines within a file.

# put data into an array open(FH, "file"); my @in=<FH>; close (FH); # loop through array for (my $i=0; $i<@in; $i++) { # if the line contains use... if ($in[$i] =~ /USE/) { # skip the line that had use in it, and loop # until the array is done or USE is encountered for ($i++; $in[$i] =~ /USE/ && $i<@in; $i++) { print $in[$i]; } } }

Not as elegent as some of my fellow monks could probably come up with, but it'll do what you want.

Update: I must be the slowest typer on the site...