An efficient computational scheme for using the relativistic and non-relativistic quasidegenerate perturbation theory with general multiconfigurational reference functions is implemented. The scheme is based on the matrix element between the reference and the zero- to two-electron ionized determinants. Comparison with a previous scheme based on diagrams is made using the excitation spectra of [PtCl4]2− , CH3I, and H2CO as examples, and the efficiency of the scheme is illustrated.