http://www.perlmonks.org?node_id=667962


in reply to IO::Socket "broken pipe"

Check out thread 393313 (since it's similar to your question). One suggestion is to add a subroutine to $SIG{PIPE} to reset your connection, but without seeing any code, it's somewhat difficult to say what you should/shouldn't do.
Update a little code goes a long way