$sock_r = IO::Socket::INET->new(Proto => "udp") or die "can't connect socket to port: $!"; $host_port = $sock_r->sockport; print "Listening on host_port $host_port\n";