in reply to Finding first block of contiguous elements in an array

Special bonus to anyone who can tell me what an agkistrodon acutus is, and how deadly is its bite.

That would be the Formosan Hundred-pace (or conehead) snake, whose bite causes skin and muscles to darken and deteriorate, accompanied by blistering and blood-tinted discharge and a slight burning sensation.

Assuming you've opened the file using the filehandle FILE, the following should work:

while ( <FILE> ) { last if /^TITLE (.*)$/; } $title = $1; while ( <FILE> ) { last if not /^TITLE (\d*) (.*)/; $title .= ' ' . $2; }