8. In Rt $\triangle A B C$, the altitude $C D$ on the hypotenuse $A B$ is $3$, extend $D C$ to point $P$, such that $C P=2$, connect $A P$, draw $B F \perp A P$, intersecting $C D$ and $A P$ at points $E$ and $F$ respectively. Then the length of segment $D E$ is $\qquad$
8. $\frac{9}{5}$.
As shown in Figure 5, let $A D=a$.
In the right triangle $\triangle A B C$, given $C D=3, C D \perp A B$, we know $B D=\frac{9}{a}$.
Notice that, in the right triangles $\triangle A P D \sim \triangle E B D$,

then $\frac{D E}{B D}=\frac{A D}{P D} \Rightarrow D E$ $=\frac{9}{a} \times \frac{a}{5}=\frac{9}{5}$.