while (<>) { if ( / ( ^ OVERVIEW \s $ ) /x .. / ( ^ AFFECTED\ PRODUCTS \s $ ) /x ) { chomp; say $_ unless $_ eq $1; } }