in reply to Read call in Net::SSH2::Channel

Under Unix/Linux, you can try using Net::OpenSSH that's more perlish:
use Net::OpenSSH; my $ssh = Net::OpenSSH->new(...); my $out_fh = $ssh->pipe_out("egrep -l $searchStr * 2>&1 | tee ~/myfile +.txt\n");
Then, the returned $out_fh object will be a real and fully working file handle that can be used, for instance, inside a non-blocking select loop.