The only lines that have undefined slopes are vertical lines. Vertical lines are found in the form x = c where c is a constant. With vertical lines, it doesn't matter what the y value is because x will always be c. In this case, c = 6 because the x-coordinate of (6, -1) is 6. Therefore, our equation is x = 6. In standard form, that would be x - 6 = 0.
This is much easier to solve if you draw it out on a graph. The perimeter is the sum of all the sides. I used the Pythagorean theorem to find the hypotenuse.