#!/usr/bin/perl -w use IO::Socket; my ($host,$port) = ("localhost","9000"); $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => $port) or die "cannot connect remote"; print STDERR "[Connected to $host:$port]\n"; while ( <$remote> ) { print }