Which file handle, the one from which gzip reads that has nothing to do with Perl? Well, you could pipe information to gzip from Perl, so you're back to using open3 or the like. Additionally, you need to feed information to gzip while reading from mycommand, so you need some kind or parallisation. You could sockify the pipes and use select or you could use threads.
It's getting complicated fast, and it might not even help enough, depending on how long it takes for mycommmand processes a pipe buffer's worth of data.
|