my $select = IO::Select->new(); my $sock = IO::Socket->new(...); $select->add($sock); while (my @sockets = $select->can_read()) { ... }