foreach (@lines) { next unless /start-phrase-here/ .. /stop-phrase-here/; # process }