in reply to reading from multicast socket

There are a few mistakes in your code:

1. You should specify local port and SO_BROADCAST flag
2. Use $@ to output error message from new()
3. recv returns the addres of sender

So, here is my code:
my $sock1 = IO::Socket::INET->new( LocalPort => 9897, PeerAddr => inet_ntoa(INADDR_BROADCAST), # you may use '127.0.0.1 +' for local host Proto => 'udp', LocalAddr => '127.0.0.1', Broadcast => 1 ); die "Can't bind to $udpcon: $@\n" unless $sock1; my $data; my $addr; print "waiting for data on $udpcon ...\n"; while (1) { $addr = recv($sock1, $data, 10, 0); }