http://www.perlmonks.org?node_id=1025989

amiss has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to read a zipped file on a remote server with Net::SFTP. Is there a way to add a pipe to do_read($handle)?

Replies are listed 'Best First'.
Re: Reading zipped files with Net::SFTP
by amiss (Initiate) on Mar 28, 2013 at 17:31 UTC

    Perhaps I spoke too soon. I ended up using Net::SFTP::Foreign and writing to a file handle like this:

    open my $handle, '| gunzip -c '; $ssh->get($remote, $handle) or die "get failed:".$ssh->error; print "opened handle \n";