in reply to Example of brainfog (Was: inconsistent regex matching)

while (<$fh> ) { if ( $_ =~ /$eot/ ) { last; } else { $_ = <$fh>; $item = $_; $item =~ s/\n//gs; $item .= "\n\n"; } if ( $item =~ /$errmsg/ ) { push @erritems, $item; } }
Maybe I'm just missing something too, and I certainly don't understand the structure of your data file, but here's what I understand of the code fragment above: What I don't understand is why you're throwing away half the lines | paragraphs in the file up to the point of the  $eot line | paragraph match.

Update: I just noticed you're reading the file in paragraph mode
    $/ = '<table align="left" border="0" cellspacing="0" cellpadding="1"';
and so changed all instances of line(s) to paragraph(s).


Give a man a fish:  <%-{-{-{-<