Perjured testimony must be given under oath. The testimony can be oral or written.
It isn’t enough for the prosecutor to prove you gave false testimony. The prosecutor must demonstrate that you knowingly and intensionally gave testimony you thought was false.
A conviction for perjury can lead to a sentence of up to five years in prison, a fine, or both.
Perjury is defined in 18 U.S. Code Section 621.