Corion has written a module that uses
Pcap/
WinPcap (which is something similar, or even related, to Ethereal) via
Net::Pcap to sniff TCP connections, more specifically, HTTP connections:
Sniffer::HTTP. I know, I know, you asked about UDP packets... But perhaps you can use it as a basis/inspiration for a tool for your purpose.