Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Unable to store the command output from Net::SSH2. Please help.

by syphilis (Chancellor)
on Oct 29, 2012 at 09:21 UTC ( #1001324=note: print w/replies, xml ) Need Help??


in reply to Unable to store the command output from Net::SSH2. Please help.

Based on what works for me on Windows (connecting to a linux server) you should be able to do:
my @output; $chan->blocking(1); $chan->exec('nas_server -list'); while (<$chan>) {push @output, $_} print for @output;
Cheers,
Rob
  • Comment on Re: Unable to store the command output from Net::SSH2. Please help.
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001324]
help
Chatterbox?
[Eily]: I just wrote a oneliner to solve a (non perl) colleague's problem, and it worked on the first try
[Eily]: and he wasn't impressed
1nickt adds gingersnaps to the platter on the sideboard.
[Eily]: sure it was a pretty standard one liner (of the $h{$1} = $2 if /regex/; END { pp \%h; } variety), but he's not supposed to know that!
[Eily]: what's the point of writing perl if people aren't impressed :P

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2017-04-26 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (482 votes). Check out past polls.