in reply to text manipulation

Do you know exactly how many lines you want removed from the top and bottom of the file? If so, it can be as easy as
# read all the lines in the file into an array @all_lines = (<INFILE>); # grab only the lines you want @stripped_lines = splice(@all_lines, 3, scalar(@all_lines)-5); # output to the new file print OUTFILE @stripped_lines;
Otherwise, if you need to evaluate the data before knowing which lines to remove, you're looking at a regular expression.