#!/usr/bin/perl use strict; use warnings; use IO::Socket::INET; my $sock = IO::Socket::INET->new(Proto => 'udp', LocalPort => 12000); while (<$sock>) { print "Received: $_"; }