When said mayor or justice shall be ready to take the testimony of a witness or witnesses so summoned he may do so on private examination or in public, or he may admit such persons as he may deem advisable, but all the testimony so taken shall be in writing and subscribed to under oath administered by said justice, and any witness swearing falsely shall be guilty of and punished for perjury. The testimony so taken shall be filed with the circuit clerk of the county on or before the first day of the circuit court thereafter, and by such clerk delivered to the foreman of the grand jury.