#* Single Client Echo server in PERL, echoing one line of text at a time *
use strict;
use IO::Socket;

my $port = 60000;

#open a server socket that listens to a port
my $server = IO::Socket::INET->new(
    LocalPort => $port,
    Type      => SOCK_STREAM,
    Reuse     => 1,
    Listen    => 3 # or maximumlength of waitng queus of remote clients
    ) or die "Could not create a TCP/IP server socket here!\n";

print "Server started on port $port\n";
my $client;
while ( $client = $server->accept() )
    my $line;
    while ($line=<$client>)
        print $client $line;

close ($server);
print "Server concluded\n";