Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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
    } else {
        warn "Unable to connect to host $host: $!\n"

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-12-01 09:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (797 votes), past polls