# just the basics use strict; use warnings; use Socket; # start up the server socket (SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp')); setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1); # My book says to use inet_aton($host) # that would be inet_aton('localhost') # but inet_aton seems to return v127.0.0.1 so I prefer to use that my $addr = sockaddr_in(110, v127.0.0.1); bind(SERVER, $addr) or die "Could not bind to port"; listen(SERVER, SOMAXCONN) or die "Could nit listen to port"; my $lines = 0; # how many lines are sent by the client my $line; # current line accept(CLIENT, SERVER); # just to be sure: binmode CLIENT; binmode SERVER; print "Nieuwe verbinding...\n"; # Dutch for 'new connection' # new connection? Send something to client print CLIENT "+OK\n"; # ... code goes on, but the above line seems never sended to the client.