use IO::Socket; if (IO::Socket::INET->new(Proto=>"udp",PeerAddr=>"host.com",PeerPort=>12121)) { ... }