LINE: while ( <> ) { next LINE if (m/\.{4}/s .. /(\+\=\+)$/); print; }