use strict; use warnings; use IO::Socket; use Cwd; my $host = 'localhost'; my $port = 2110; my $socket = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => "tcp", Type => SOCK_STREAM ) or die( "Cannot connect to $host:$port : $@\n" );