In the following code I need to print output from the variables $stout, $stderr. How can I do this and not without using $ssh = Net::SSH::Perl->new?
#!/usr/bin/perl
use strict;
use warnings;
use Net::SSH::Perl;
use FindBin qw($RealBin);
use File::Basename;
use lib "/nfs/site/proj/dpg/tools/lib/perl";
use Util;
use Getopt::Std;
use Net::SSH::Perl;
use Cwd;
use File::Copy;
my $host = 'someip.com.com';
my $pass = '';
my $user = '';
my $cmd = 'pwd';
my($stdout,$stderr,$exit) = system('ssh someip.com cat /nfs/site/home/aa/test11.txt') ;
if ($stdout) {
print "Standard output is \n$stdout";
} elsif($stderr) {
print "Standard error is \n$stderr";
}