Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Writing to an SSH channel

by salva (Canon)
on Sep 19, 2018 at 07:26 UTC ( [id://1222627]=note: print w/replies, xml ) Need Help??


in reply to Writing to an SSH channel

You may like to check Net::SSH::Any. It works on top of Net::SSH2 (and other SSH modules), and provides a much higher level and easy to use API.

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);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222627]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found