#!/usr/bin/perl -w # Server Program use IO::Socket::INET; print ">> Server Program <<\n"; # Create a new socket $MySocket=new IO::Socket::INET->new(LocalPort=>1234,Proto=>'udp'); # Keep receiving messages from client while(1) { $MySocket->recv($text,1024); if($text ne '') { print $text,"\n"; } # If client message is empty exit else { print "Cilent has exited!","\n"; exit 1; } }