in reply to writing to telnet?
#!/usr/bin/perl use strict; use warnings; use IO::Socket; my $server = IO::Socket::INET->new ( LocalPort => 1337, Type => SOCK_STREAM, Reuse => 1, Listen => 5 ) or die "could not open port\n"; warn "server is ready for connection..... \n"; while (my $client = $server->accept()) { warn "client connected\n"; #while($line = <$client>){ #print $line;} my $line = <>; print $client $line; } close($server);
|
|---|