#!/usr/bin/perl use IO::Socket; my $client = 0; my $server_socket = new IO::Socket::INET ( localPort => 13, Listen => $SOMAXCONN, Proto => 'tcp', Reuse => 1) || die "blabla"; print "\nWartend..\n"; &read(); $server_socket->close(); sub read() { $client = $server_socket->accept(); my $byte; while (sysread($client, $byte, 1) == 1) { print STDOUT $byte; } }