1234567891011121314
sub read_sock { if(my @ready = $select->can_read(0)) { print "es liegt eine neue Message vor:\n"; foreach my $sock (@ready) { my $line = $sock->getline; if(defined $line) { print "Client says: [$line]\n"; } else { $select->remove($sock); $sock->close; } } }}