An alternative approach is the old-fashioned state machine:
- set $/ to the first character of the separator (this is less likely to use gigabytes than looking for all 4). Read and discard a block.
- now read the next character: if it's the first char of the separator then repeat; if it's not the second, then goto step 1
- now read the next: if it's not the third, then goto step 1
- read the next: if it's the fourth, then you've found the start of your block. Otherwise, goto 1
Now repeat a similar SM for the end separator (the only difference is tat you don't discard anything while you're in the middle of your block.--Dave