use Net::SSH qw(sshopen2); use strict; my $user = "flexpm"; my $host = "155.226.230.99"; my $cmd = "ls"; sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: Error $!"; while () { chomp(); print "$_\n"; } close(READER);