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"
    }