#!/usr/bin/perl -w use IO::Socket; $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "210.212.226.195", PeerPort => "ssh(22)", ) || die "cannot connect"; $remote->autoflush(1); while (defined ($line = <$remote>)) { print STDOUT $line; } $remote->exit(0); print "Hello World!";