  The Krotov combining construction of perfect 1-error-correcting binary codes
from 2000 and a theorem of Heden saying that every non-full-rank perfect
1-error-correcting binary code can be constructed by this combining
construction is generalized to the $q$-ary case. Simply, every non-full-rank
perfect code $C$ is the union of a well-defined family of $\mu$-components
$K_\mu$, where $\mu$ belongs to an "outer" perfect code $C^*$, and these
components are at distance three from each other. Components from distinct
codes can thus freely be combined to obtain new perfect codes. The Phelps
general product construction of perfect binary code from 1984 is generalized to
obtain $\mu$-components, and new lower bounds on the number of perfect
1-error-correcting $q$-ary codes are presented.
