use strict; use warnings; use IO::Socket::INET; $|++; my $port = 9870; print "Listening on UDP port: $port\n"; my $sock = IO::Socket::INET->new( Proto => 'udp', LocalPort => $port, Broadcast => 1 ) or die "Can't bind : $@\n"; my $mess; while ($sock -> recv ($mess, 2048)) { print "Saw: \n$mess\n"; }