Section 1. Whoever, being lawfully required to depose the truth in a judicial proceeding or in a proceeding in a course of justice, wilfully swears or affirms falsely in a matter material to the issue or point in question, or whoever, being required by law to take an oath or affirmation, wilfully swears or affirms falsely in a matter relative to which such oath or affirmation is required, shall be guilty of perjury. Whoever commits perjury on the trial of an indictment for a capital crime shall be punished by imprisonment in the state prison for life or for any term of years, and whoever commits perjury in any other case shall be punished by imprisonment in the state prison for not more than twenty years or by a fine of not more than one thousand dollars or by imprisonment in jail for not more than two and one half years, or by both such fine and imprisonment in jail.
An indictment or complaint for violation of this section alleging that, in any proceedings before or ancillary to any court or grand jury proceedings relating to an indictment or complaint for the commission of a violent crime, as defined in section 121 of chapter 140, the defendant under oath has knowingly made 2 or more declarations, which are inconsistent to the degree that 1 of them is necessarily false, need not specify which declaration is false if: (1) each declaration was material to the point in question and (2) each declaration was made within the period of the statue of limitations for the offense charged under this section. In any prosecution under this section, the falsity of a declaration set forth in the indictment or complaint shall be established sufficient for conviction by proof that the defendant, while under oath, made irreconcilably contradictory declarations material to the point in question. If, in the same continuous court or grand jury proceeding in which a declaration is made, the person making the declaration admits to such declaration to be false, such admission shall bar prosecution under this section if, at the time the admission is made, the declaration has not substantially affected the proceeding, or it has not become manifest that such falsity has been or will be exposed. It shall be a defense to an indictment or complaint made pursuant to this section that the defendant, at the time he made each declaration, believed each such declaration to be true or its falsity was the result of a good faith mistake or error.