while(my $s = <$fh>) { index( $s, 'Query' ) != -1 && $match_count1++;; }