I'm having one of those brain fart days. (Lack of sleep on a Friday and all that.)

Could anyone please help by sending in a nice and simple algorithm for determining the shortest distance between a point (px,py) and a line segment(x1,y1)-(x2,y2)? Thanks.