Example 2 The sum of two positive integers is 1997 less than their product, and one of them is a perfect square. Then the larger number and the smaller (1997, Tianjin Junior High School Mathematics Competition)
Solution: Let the two positive integers be $\alpha, \beta$, and $\alpha>\beta$. Then
$$
\begin{array}{l}
\alpha+\beta+1997=\alpha \beta . \\
\therefore \alpha \beta-\alpha-\beta+1=1998,
\end{array}
$$

which means
$$
\begin{array}{l}
(\alpha-1)(\beta-1) \\
=1998=999 \times 2=333 \times 3 \times 2 .
\end{array}
$$

Since one of $\alpha, \beta$ is a perfect square, then
$$
\alpha-1=3, \beta-1=666
$$

or $\beta-1=3, \alpha-1=666$.
$$
\begin{array}{l}
\therefore \alpha=4, \beta=667, \text { or } \beta=4, \alpha=667 . \\
\because \alpha>\beta, \\
\therefore \alpha=667, \beta=4 .
\end{array}
$$

Therefore, the difference between the larger number and the smaller number is 663.