in reply to Writing to an SSH channel
It also takes into account a lot of Net::SSH2 quirks and corner cases you are not handling.
my $ssh = Net::SSH::Any->new(..., backend => 'Net_SSH2'); my ($out, $err) = $ssh->capture2({stdin_data => $sendtext}, $cmd);
|
|---|