CONNECT: $socket = IO::Socket::INET->new("$host:$port"); unless ($socket) { # Potential Problem here $retry++; if ( $retry == 3 ) { log_die("Client : Error connecting to server ... $@\n"); } log_notice("Client : Retry $retry : Sleeping $timeout Seconds\n"); sleep($timeout); # wait a minute; goto CONNECT; } $retry = 0; #Reset in case we disconnect early $connected = 1; #So that we know... #### print $socket "tail\n"; # Rock n Roll