$server = IO::Socket::INET->new( Listen => 5, LocalAddr => 'localhost', LocalPort => $local_port, Proto => 'tcp') or die "Cant create server socket: !"; while ($client = $server->accept) { $proxy = IO::Socket::INET->new( PeerAddr => $proxy_host, PeerPort => $proxy_port, Proto => 'tcp') or die "cannot create proxy socket: $!" # At this point here I want to connect the $proxy file handle and # the $client file handle .. }