use IO::Select; ... # Check for and process any pending socket input # avoid steping on toes by keeping running list of ready # sockets and process it untill empty sub ckSockets { # Returns: # of ready so we can tell activity ... my @breadys = $io_select_obj->can_read(0); foreach my $fd_key (@breadys) { ...read and process data from this socket... }