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

I prefer this:
use strict; use warnings; use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('server'); $ssh2->auth_password('username','passwd'); my $shell = $ssh2->channel(); $shell->blocking(0); $shell->shell(); print {$shell} "egrep -l $searchStr * 2>&1 | tee ~/myfile.txt\n"; # <$shell> works, but <$hash{$shell_box1}> does not, so my @results = readline($shell);
Error-trapping left as an exercise for the reader