in reply to Record separator question
Given that records in your file begin with the line "====header info====\n", you could set this whole string as your record separator, and just accept the fact that the first "record" you read in will contain nothing else but this line, and that all subsequent records will have this line as the end of the record string, not the beginning.
Something like the following would do what you want, assuming that you're okay with actually removing these record separators and keeping just the stuff in between:
(I tried this out on your sample text, and it did the right thing, even with the last record, which did not have "====header info====" at the end.)$/ = "====header info====\n"; while (<>) { chomp; next unless ( /\S/ ); .... }
|
|---|