I have a file which contains the text below.
#L_ENTRY
#LEX >
#ROOT >
#POS
#SUBCAT
If you set the input record separator variable to the empty string, then perl will work in paragraph mode, and return a block at a time separated by one or more blank lines in the input data
use strict;
use warnings 'all';
local $/ = '';
my $n;
while ( ) {
printf "Block %d:\n<<%s>>\n\n", ++$n, $_;
}
__DATA__
A
B
C
D
E
F
A
B
C
D
E
F
Block 1:
<>
Block 2:
<>