http://www.perlmonks.org?node_id=1012637


in reply to While Loops

Read the lines in an array; use &List'MoreUtils'natatime to process that array in blocks.