use 5.010; use strict; use warnings; use IO::Socket; my $socket = IO::Socket::INET->new(Proto => 'tcp', PeerAddr => 'localhost', PeerPort => 8000, Timeout => 10) or die; say 'Client connected';