while () { push @lines, $_; } $word = ; foreach (@lines) { print if /$word/; } # File data is stored until $word is known. # Officiate gets correct output, is pleased while file is small. # Monk is thrashed when the disk thrashes on a large file.