use strict; use warnings; use Net::SSH qw(sshopen3); my $command = "/some/remote/command"; my $reader = IO::File->new(); my $writer = IO::File->new(); my $error = IO::File->new(); sshopen3( "$user\@$host", $writer, $reader, $error, $command ) or die $!;