.... #Schleife, für die Kommunikation while(defined(my $msg_out = )) { #Verschlüsseltes Passwort if ($msg_out =~ /Pw: (.*)\n/) { my $temp = $1; my $passwd = crypt("$temp", "oO"); print $socket "Pw: $passwd"; } else { #Nachricht verschicken print $socket $msg_out; #Nachrichten empfangen my $msg_in = <$socket>; #Nachricht ausgeben print $msg_in; } } ....