#!/bin/perl #Send one UDP datagram to the daytime server at port 10567/udp #on the host i5.nyu.edu (128.122.108.193). #Print the reply. use Socket; socket(S, PF_INET, SOCK_DGRAM, getprotobyname('udp')) || die "$0: $!"; $port = 10567; $ip = inet_aton('128.122.108.193'); defined(send(S, '', 0, sockaddr_in($port, $ip))) || die "$0: $!"; recv(S, $buffer, 100, 0); print "I received the datagram $buffer\n"; exit 0;