use IO::Socket::INET ; use Thread ; $|++; $t = IO::Socket::INET->new( LocalAddr => "localhost", LocalPort => 90 , Listen => 1 ); $con = $t->accept(); Thread->new(\&reader_stream , $con); while(1){ $get = ; chomp($get); $con->autoflush(1); $con->send($get); } sub reader_stream { my $con2 = shift ; while(defined(my $recive = $con2->getline)){ print $recive."\n" ; } } close $t;