  A version of the configuration interaction (CI) method is developed which
treats highly excited many-electron basis states perturbatively, so that their
inclusion does not affect the size of the CI matrix. This removes, at least in
principle, the main limitation of the CI method in dealing with many-electron
atoms or ions. We perform calculations of the spectra of iodine and its ions,
tungsten, and ytterbium as examples of atoms with open $s$, $p$, $d$ and
$f$-shells. Good agreement of the calculated data with experiment illustrates
the power of the method. Its advantages and limitations are discussed.
