#! perl -slw use strict; use IO::Socket; use constant { HEARTBEAT => 1, ## seconds AREYOUTHERE => 'Er, hello?', IPS => [ map{ scalar sockaddr_in( $_, inet_aton( '127.0.0.1' ) ) } 10001..10005 ], }; my $s = IO::Socket::INET->new( Proto => 'udp' ) or die $!, $^E; ## Forever, slowly until time to die while( sleep HEARTBEAT ) { for my $client ( 0 .. $#{ IPS() } ) { $s->send( "$client: " . AREYOUTHERE, 0, IPS->[ $client ] ) } }