my $server = IO::Socket::INET->new(Proto => 'tcp',                                                        LocalPort => $port,                                                        Listen => 5,                                                        Reuse => 1) || die "Socket: $!"; my $select = IO::Select->new($server); while (my @ready = $select->can_read()) {     foreach my $handle (@ready) {         if ($handle == $server) {             my $newclient = $server->accept();             $newclient->autoflush();             $select->add($newclient);             print $newclient "Hallo, bitte logge dich ein\n";         }         else {             if (defined (my $line = <$handle>)) { # hier steht was der client geschickt hat und dann halt entsprechend reagieren...             }         }     } }