$ perl net-ssh.t localhost user: thartman localhost command: ls blee learning nbarter pari-2.1.7 pari-2.1.7.tgz pimpmycat pmc_external_dependencies shellenv $ cat net-ssh.t use strict; use warnings; use Net::SSH qw(sshopen2); use IO::Prompt; my $ssh_box = "localhost"; my $user = prompt "$ssh_box user: ";; my $cmd = prompt "$ssh_box command: "; sshopen2("$user\@$ssh_box", *READER, *WRITER, "$cmd") || die "ssh: $!"; while () { chomp(); print "$_\n"; } close(READER); close(WRITER);