in reply to capturing blocks of data
On the other hand, if the ">>" that precedes the first occurrence of each HOSTNAME string is reliable, and if that pattern occurs only as the initial two characters of a new record, then just set perl's record separator variable ($/) to ">>". That way, the standard while loop with the diamond operator will read one full record at a time.
|
|---|