in reply to Record separator question

I'm not exactly sure what you want because I can interpret your text several ways. Here's a couple of snippets of code though. The first assumes that you really want something like this:

====header info==== header header ====header info==== data data ====header info==== header header ====header info==== data ....

... and so on. While the second assumes that you just want the stuff that's in between the ====header info==== lines while discarding the header lines themselves. The second one is what I believe most people interpret your text to mean, but I thought I'd mention the first one just in case (also, it's a rare chance that I get to use the ... (yes, that's 3 dots!) flip-flop operator ;-)

#!/usr/bin/perl # snippet number 1 while (<DATA>) { if (/^====header/.../^====header/) { print "header: $_"; next; } print "data: $_"; next; } __DATA__ ====header info==== 10 to 50 line of text and numbers with irregular formatting ====header info==== 10 to 50 lines of text and... More text more text ====header info==== 10 to 50 line of text and numbers with irregular formatting ====header info==== 10 to 50 lines of text and... More text more text
#!/usr/bin/perl # snippet number 2 my (@records,@tmp); while (<DATA>) { chomp; if (/^====header/) { next unless @tmp; push @records, [ @tmp ]; @tmp = (); next; } push @tmp, $_; } push @records, [ @tmp ] if @tmp; print "@$_\n" for @records; __DATA__ ====header info==== 10 to 50 line of text and numbers with irregular formatting ====header info==== 10 to 50 lines of text and... More text more text ====header info==== 10 to 50 line of text and numbers with irregular formatting ====header info==== 10 to 50 lines of text and... More text more text