use IO::Socket;
$sock = new IO::Socket::INET (LocalAddr => 'maude.ora.com',
LocalPort => 8888,
Proto => 'tcp',
Listen => 5);
die "$!" unless $sock;
The parameters for the new socket object determine whether it is a
server or a client socket. Because we're creating a
server socket, LocalAddr and
LocalPort provide the address and port to bind to
the socket. The Listen parameter gives the queue
size for the number of client requests that can wait for an
accept at any one time.