Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Net::SSH2 command output polling

by VinsWorldcom (Vicar)
on Oct 12, 2012 at 12:38 UTC ( #998671=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @poll = ({handle => $chan, events => 'in'});
    if($ssh2->poll(250, \@poll) && $poll[0]->{revents}->{in}) {
        print $buf while defined ($len = $chan->read($buf,512))
    }
    
  2. or download this
    my ($rin, $rout, $ein, $eout) = ('', '', '', '');
    vec($rin, $chan, 1) = 1; # tried $ssh2 and $chan, 
    ...
    if (select($rout=$rin, undef, $eout=$ein, 5000)) {
        print $buf while defined ($len = $chan->read($buf,512))
    }
    
  3. or download this
    #!/usr/bin/perl
    
    ...
    } else {
        warn "Unable to connect to host $host: $!\n"
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://998671]
Approved by BrowserUk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (14)
As of 2015-07-07 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (89 votes), past polls