!/usr/bin/perl use strict; use warnings; use IO::Socket::INET; my $sock = IO::Socket::INET->new( PeerPort => 9999, PeerAddr => inet_ntoa(INADDR_BROADCAST), Proto => 'udp', LocalAddr => 'localhost', Broadcast => 1 ) or die "Can't bind: $@\n";