Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Net::SSH2 command output polling

by VinsWorldcom (Priest)
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 pondering the Monastery: (8)
As of 2014-09-19 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (133 votes), past polls