#!/usr/local/bin/perl -w use strict; use IO::Select; use IO::Socket; my $server = '127.0.0.1'; for (8721 .. 8724) { my $fd = new IO::Socket::INET( PeerAddr => $server, PeerPort => $_, Proto => 'udp'); my $sockin = new IO::Select( $fd ); eval { $fd->send( 'Test string' ); my $read = IO::Select->select( $sockin, undef, undef, 3); print "READ *$read*\n"; die "IO select timed out" unless $read; }; print "Read $@" if $@; }