foreach ( @chat[$E{$ID} .. $#chat] ) { # spilt into ID and incomming line /(.+?)\s(.+)[\n\r]*/; # send only line print $socket $2,$EOL if ( $1 ne $ID && $2 ne $kill); }