  Let $R$ be a commutative ring with unity not equal to zero and let
$\Gamma(R)$ be a zero-divisor graph realized by $R$. For a simple, undirected,
connected graph $G = (V, E)$, a {\it total perfect code} denoted by $C(G)$ in
$G$ is a subset $C(G) \subseteq V(G)$ such that $|N(v) \cap C(G)| = 1$ for all
$v \in V(G)$, where $N(v)$ denotes the open neighbourhood of a vertex $v$ in
$G$. In this paper, we study total perfect codes in graphs which are realized
as zero-divisor graphs. We show a zero-divisor graph realized by a local
commutative ring with unity admits a total perfect code if and only if the
graph has degree one vertices. We also show that if $\Gamma(R)$ is a regular
graph on $|Z^*(R)|$ vertices, then $R$ is a reduced ring and $|Z^*(R)| \equiv
0(mod ~2)$, where $Z^*(R)$ is a set of non-zero zero-divisors of $R$. We
provide a characterization for all commutative rings with unity of which the
realized zero-divisor graphs admit total perfect codes. Finally, we determine
the cardinality of a total perfect code in $\Gamma(R)$ and discuss the
significance of the study of total perfect codes in graphs realized by
commutative rings with unity.
