my $clientfd = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port, Proto => "tcp", Type => SOCK_STREAM); if ($@) { my $conn_err = "Could not connect to $host:$port:$@"; }