die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error;
my $ssh_opt = {};
$ssh_opt->{'stdin_data'} = $opt->{'stdin_string'}
if exists($opt->{'stdin_string'}) and length($opt->{'stdin_string'});
my ($output, $errput) = $ssh->capture2($ssh_opt, $opt->{'command'});
die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error;
my $ssh_opt = {};
$ssh_opt->{'stdin_data'} = $opt->{'stdin_string'}
if exists($opt->{'stdin_string'}) and length($opt->{'stdin_string'});
my ($output, $errput) = $ssh->capture2($ssh_opt, $opt->{'command'});