in reply to Re: Problem with data retrieved from Net::SSH:perl
in thread Problem with data retrieved from Net::SSH:perl
If the output is potentially large...If the output from (or the input to) the command is large, there is an experimental, undocumented open2 method (which btrott informed me of while I was writing a file transfer script). It returns tied filehandles, so they won't work as arguments for some things which require real filehandles (like old versions of File::Copy or Net::FTP).
# I may have in and out reversed here, try both ways my ($out, $in)=$ssh->open2("command and args"); close $in; while (<$out>) { # Process output } close $out;
|
|---|