my $readable = IO::Select->new; $readable->add($oneSock, $twoSock, $redSock, $blueSock); while (not $done) { my $ready = IO::Select->select($readable); foreach my $socket (@$ready) { # Deal with whatever $socket has to say } }