  The heats of formation of HClO$_4$ and Cl$_2$O$_7$ have been determined to
chemical accuracy for the first time by means of W1 and W2 theory. These
molecules exhibit particularly severe degrees of inner polarization, and as
such obtaining a basis-set limit SCF component to the total atomization energy
becomes a challenge. (Adding high-exponent $d$ functions to a standard $spd$
basis set has an effect on the order of 100 kcal/mol for Cl$_2$O$_7$.) Wilson's
aug-cc-pV(n+d)Z basis sets represent a dramatic improvement over the standard
aug-cc-pVnZ basis sets, while the aug-cc-pVnZ+2d1f sequence converges still
more rapidly. Jensen's polarization consistent basis sets still require
additional high-exponent $d$ functions: for smooth convergence we suggest the
\{aug-pc1+3d,aug-pc2+2d,aug-pc3+d,aug-pc4\} sequence. The role of the tight $d$
functions is shown to be an improved description of the Cl (3d) Rydberg
orbital, enhancing its ability to receive back-bonding from the oxygen lone
pairs. In problematic cases like this (or indeed in general), a single
SCF/aug-cc-pV6Z+2d1f calculation may be preferable over empirically motivated
extrapolations. Our best estimate heats of formation are $\Delta
H^\circ_{f,298}[$HClO$_4$(g)$]=-0.6\pm$1 kcal/mol and $\Delta
H^\circ_{f,298}[$Cl$_2$O$_7$(g)$]=65.9\pm$2 kcal/mol, the largest source of
uncertainty being our inability to account for post-CCSD(T) correlation
effects. While G2 and G3 theory have fairly large errors, G3X theory reproduces
both values to within 2 kcal/mol.
