title: FTP + uncompress + readline
body: <p>I want to extract some data from a large-ish (3+ GB, <em>gzipped</em>) FTP download, and do this on-the-fly, to avoid dumping then full download on my disk.</p>
  
  <p>To extract the desired data I need to examine the <em>uncompressed</em> stream <em>line-by-line</em>.</p>
  
  <p>So I'm looking for the moral equivalent of</p>
  
  <pre><code>use PerlIO::gzip;
  
  my $handle = open '&lt;:gzip', 'ftp://ftp.foobar.com/path/to/blotto.txt.gz'
               or die $!;
  for my $line (&lt;$handle&gt;) {
      # etc.
  }
  close($handle);
  </code></pre>
  
  <p>FWIW: I know how to open a read handle to <code>ftp://ftp.foobar.com/path/to/blotto.txt.gz</code> (with <code>Net::FTP::repr</code>), but I have not yet figured out <em>how to add a <code>:gzip</code> layer to this open handle</em>.</p>
  
  <hr>
  
  <p>It took me a lot longer than it should have to find the answer to the question above, so I thought I'd post it for the next person who needs it.</p>