use Net::OpenSSH; my $ssh = Net::OpenSSH->new($myhostname, user => $user, master_stderr_discard => 1 # quiet! ); my $output = $ssh->capture("cat /etc/redhat-release");