In general IO::Socket process (regardless of which socket and what type of socket to use) what should be the recommended process to detect if the remote machines are alive/reachable if you dont want to put a DIE command after the IO::Socket::INET->new() process? (of course, to avoid HANG and probably you would have other codes to execute after the socket connect process...) #### sub doit { $host="$aa.$bb.$cc.$dd"; $port="23"; $fnd=""; $pong=`ping -c 3 $host -v`; #is there really a "-t" option here? $fnd=($pong=~m/(...)%/gi); $xcd=$1; if ($xcd!=100) { $remote = IO::Socket::INET -> new ( Proto => "tcp", PeerAddr => $host, PeerPort => $port, Timeout => 1 ); $| = 1; if ($remote) { close $remote; print "Socket ready..."; } else { print "Try again!"; } } }