8. (40 points) Figure 6 shows that a regular octagon can be cut into one $1 \times 1$ square and four congruent pentagons, which can be reassembled into a square. Try to find the perimeter of each pentagon.
8. As shown in Figure 12 (a), let the side length of the square be $a$.

Then
$$
A B+B C=C G+B C=a .
$$

It is known that the side length of the regular octagon is 1.
Cut the regular octagon as shown in Figure 12 (b).
Thus, the area of the regular octagon is
$1+1 \times \frac{\sqrt{2}}{2} \times 4+\frac{1}{2} \times \frac{\sqrt{2}}{2} \times \frac{\sqrt{2}}{2} \times 4=2+2 \sqrt{2}$.
Therefore, $a^{2}=2+2 \sqrt{2} \Rightarrow a=\sqrt{2+2 \sqrt{2}}$.
Hence, $A B+B C=C G+B C=\sqrt{2+2 \sqrt{2}}$.
Also, $A E+D C$ is the side length of the regular octagon, so $A E+D C=1$.
Thus, $A B+B C+C D+D E+E A=2+\sqrt{2+2 \sqrt{2}}$.