in reply to IO::Socket "broken pipe"

You'll get a broken pipe message if one process shuts down their side of the connection and then the other process tries a write operation on the connection. The writer will get the broken pipe exception.

If you are doing "clean" shutdowns there must be something amiss with your protocol - your client and server are not "on the same page" so to speak. A work-around is to catch/ignore the SIGPIPE exception in your server with:

$SIG{PIPE} = 'IGNORE';

If your server is only serving one client at a time, you can assume that the client caused the exception and you can have the SIGPIPE handler take the appropriate action. If your server can server multiple clients at a time, you won't be able to tell which client caused the exception.