If you set $/ to "" you will read paragraphs at a time. That is, you will read a block of lines that are separated by 1 or more blank lines. Then you can split on newline boundaries:
$/ = ""; # read paragraphs
while (my $para = <>)
my @lines = split(/\n/, $para);
if (@lines == 1) # heading?
$lastHeading = $lines;
if ($lastHeading eq 'MEANINGLESS TEXT')
$hitMe = $lines; # fifth line
elsif ($lastHeading eq 'ALTERNATIVE TEXT')
$hitMe = $lines; # sixth line
# now do something...