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


in reply to Extract the lines

Unlikely in a homework exercise, but if your file was REALLY large, this is a perfect place to use the brilliant File::SortedSeek - it would let you find your matching lines in O(log n) time.

Mike