Example 7 (2002 Australian National Mathematics Competition) Find all prime numbers $p, q, r$ such that $p^{q}+p^{r}$ is a perfect square.
If $q=r$, then $p^{q}+p^{r}=2 p^{q}$, so, $p=2, q$ is an odd prime. Therefore, $(2, q, q)$ is a three-element array that satisfies the condition, where the prime $q \geqslant 3$.
If $q \neq r$, without loss of generality, assume $q<r$, then
$p^{q}+p^{r}=p^{q}\left(1+p^{s}\right)$, where $s=r-q \geqslant 1$.
Since the greatest common divisor of $p^{q}$ and $1+p^{s}$ is 1, $p^{q}$ and $1+p^{s}$ are both perfect squares, hence $q=2$.
Since $1+p^{r}$ is a perfect square, let $1+p^{s}=u^{2}$, that is
$$
p^{s}=u^{2}-1=(u+1)(u-1) \text {. }
$$

Since the greatest common divisor of $u+1$ and $u-1$ is 1 or 2, when the greatest common divisor is 2, $u$ is odd, $p$ is even, i.e., $p=2$, and $u-1$ and $u+1$ are both powers of 2, so $u=3$. Thus $1+2^{s}=3^{2}$, so,
$$
s=3, r=q+s=2+3=5 .
$$

Therefore, the three-element arrays that satisfy the condition are
$(2,2,5)$ and $(2,5,2)$.
When the greatest common divisor of $u+1$ and $u-1$ is 1, $u$ is even, $u-1$ must be 1, otherwise $u-1$ and $u+1$ can be expressed as the product of different odd primes, so it cannot be an integer power of a prime. Thus,
$$
\begin{array}{l}
u=2, p^{s}=(u-1)(u+1)=3, p=3, s=1, \\
r=q+s=3 .
\end{array}
$$

Therefore, the three-element arrays that satisfy the condition are
$(3,2,3)$ and $(3,3,2)$.
In summary, the solutions to the original proposition are
$(2,2,5),(2,5,2),(3,2,3),(3,3,2),(2, q, q)$, where the prime $q \geqslant 3$.