in reply to using TCP as a resource lock: should I do this?

In the get_lock subroutine, I wouldn't use a spin lock (your loop there). I'd do something more like:
while (++$num_tries < 10) { if( $lock = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $server, PeerPort => $port) ) { $lock->autoflush(1); last; } sleep 1; # wait a second, don't tie up the CPU }
That'll be a little gentler as sleep doesn't spin in a tight loop.

Any errors in logic or code should be excused as I'm still jet lagged.