I solved for the length of one side, which came out to (3/2)x -5.
Let's try something new:
Perimeter = 6x - 20 = 2W + 2L, but here W = L because this is a square.
Then 6x - 20 = 4W = 4x
Then 6x - 4x = 20;   2x = 20;   x = 10.
This is a square with side length 10.  Its perimenter is thus 4(10) = 40.
Does 6(10) - 20 = 40?  Yes.  So, x = 10.