When I'm using perfboard, i like to design the layout of the components directly on the board. When the entire circuit is laid out, there's no easy way to turn the board for soldering. Inspired by a rack Bigclive used in a video (https://www.youtube.com/watch?v=wO192EU4BGQ), I made this jig.
The idea is quite simple. Use a perfboard the same size as the one the circuit is on, as a holder for the foam. Use standoffs so that the foam is pressed enough to keep the components firm. I have cut some corners in the foam, to keep it in place. Hold the two boards in one hand, while screwing the board with the circuit on. As the pictures show, even though there seem to be a gap above the TO-220 package, the socket still have its short legs through the board.