in reply to sockets and such in Perl

A common pattern in multi process/thread design you could use to simplify your life here is the "manager-worker model".

Shortly, one process acts as a manager and "spawns" workers as needed. Each worker knows only of its manager - through a single socket. The worker's task is simple - it gets a job from the manager, does it and reports back. The manager handles the coordination between workers and distributes jobs for them.