in reply to extract regions

It's not clear what you want. A construct like:
while (<>) { if (/begin/ ... /end/) { ... } }
still reads the entire file, line-by-line. If your file consists of 'records' that start with ^lmo\d+, and end with the next occurence, playing with the range operator doesn't make much sense; you might as well do a straigth while (<>) { ... } loop.

What is it what you really want?

Abigail