while( my $line = <$fh> and $line !~ /TOTAL COMMAND SUMMARY/) { ... }