>It is a well known fact that product of slopes of two
>perpendicular lines is -1. What is, perhaps, less known is that that condition was derived under the assumption that none of the two slopes is 0, which obviates your question.
All forms of line equations that have slope in them embed an inherent limitation. E.g., the slope-intercept form: y = mx + b does not make sense for vertical lines.
Lines in the plane are more universally described by vectors normal or parallel to their direction. E.g. r = ta + r0, where the bold letters stand for vectors, t is a parameter, describes the line through the endpoint of vector r0 parallel to vector a. The later plays the role of the slope. Let's call it vector-slope. The vector-slope could be scaled without changing the line. If the line is not vertical, its vector-slope could be taken to be a = (a, 1), where a is the regular (scalar) slope.
The lines are perpendicular if their vector-slopes, say (a1, a2) and (b1, b2), are perpendicular: a1·b1 + a2·b2 = 0.For non-vertical lines (with slopes (a1, 1) and (b1, 1)) this reduces to a1·b1 + 1·1 = 0, which is the statement you made a reference to.
Vertical lines are parallel to vectors (0, b), horizontal ones to vectors (a, 0). These are of course perpendicular. However, the condition of their normality is not expressible in terms of scalar slopes.