use IO::Socket::INET; my $socket = new IO::Socket::INET ( LocalPort => 8069, Proto => 'tcp', Listen => SO_MAXCONN); while ($client_socket = $socket->accept()) { print "Connection received from ",$client_socket->peerhost(),"\n"; # Do stuff with the $client_socket... }