Server.pl

#!/usr/bin/perl

# Server.pl

# - Jim

use strict;
use warnings;

# We want to listen on a port.
use IO::Socket;

# Create a new listening pipe on the port, and protocol
# listed.
my $Socket = IO::Socket::INET->new(LocalPort => 4321,
                                    Proto     => "udp");
print "Waiting ...\n\n";

# Start listening.
# Take in up to 128 characters.
$Socket->recv(my $text, 128);

print "Got this message:\"$text\"\n";