local $/ = 'END OF REPORT'; while () { print "$1\n" if m/(^\*+\sparameters after change\s=\*+\n.+?^\*+\sNRG location\s=\*+$)/ms; }