in reply to sharing (io::socket) objects with threads

Sounds like you've got 1 output/IRC thr which talks to multiple external progs (brain progs).
1 option is to use a tcp connect with timeout option eg:
if( !$send_socket ) { # Create socket $socket_errmsg = ""; $send_socket = IO::Socket::INET->new( PeerAddr => $server_ip, PeerPort => $server_port, Proto => "tcp", Timeout => $cfg::params{'CONNECT_TIMEO +UT'} ) or $socket_errmsg = "Couldn't create socket to ". "$server_ip port $server_port: + $@"; }
Another is to have 1 IRC thr per brain prog (if you haven't got too many) and do the same.
Either try to re-connect from the thr that has a dead cxn, or get it to mark a thr shared hash (%brains) that the cxn is dead, then terminate naturally and get the controlling thr to initiate a new thr to connect to the brain prog.
The latter might be pref, as you'll prob have to reset any thr private vars anyway.

Cheers
Chris