The perimeter P of a rectangle of length L and width l is
[tex]P = 2L + 2l[/tex]
Here you know P =108 and l=27. Thus you have the equation
[tex]108 = 2L + 2 \times 27 = 2L + 54[/tex]
You simplify a bit by moving the 54 on the left side
[tex]54 = 2L[/tex]
and you find L=27 cm.
Oh my, this is a square!