  In this paper we study nearly perfect sequences (NPS) via their connection to
direct product difference sets (DPDS). We prove the connection between a
$p$-ary NPS of period $n$ and type $\gamma$ and a cyclic
$(n,p,n,\frac{n-\gamma}{p}+\gamma,0,\frac{n-\gamma}{p})$-DPDS for an arbitrary
integer $\gamma$. Next, we present the necessary conditions for the existence
of a $p$-ary NPS of type $\gamma$. We apply this result for excluding the
existence of some $p$-ary NPS of period $n$ and type $\gamma$ for $n \leq 100$
and $\vert \gamma \vert \leq 2$. We also prove the similar results for an
almost $p$-ary NPS of type $\gamma$. Finally, we show the non-existence of some
almost $p$-ary perfect sequences by showing the non-existence of equivalent
cyclic relative difference sets by using the notion of multipliers.
