my ($rin, $rout, $ein, $eout) = ('', '', '', ''); vec($rin, $chan, 1) = 1; # tried $ssh2 and $chan, # but should be: fileno($var) which errors if (select($rout=$rin, undef, $eout=$ein, 5000)) { print $buf while defined ($len = $chan->read($buf,512)) }