open LOG, "<$logfile" or die "Blerch: $!\n"; while () { if (/string-in-the-middle/) {print "$_";} if (/^string-at-the-beginning/) {print "$_";} }