in reply to gzip written in perl
With Perl 5.8, you can also use PerlIO::gzip and read/write
gzip data though an IO layer -- e.g. here's a script that
reads a gzipped file, numbers the lines, and writes the
result to a new gzipped file:
(God, I love it!)use PerlIO::gzip; open IN, "<:gzip", "somefile.gz" or die "$!\n"; open OUT, ">:gzip", "numbered.gz" or die "$!\n"; while (<IN>) { print OUT join " ", ++$i, $_; }
UPDATE: (2010-10-18) It seems that PerlIO::gzip should be viewed as superseded by PerlIO::via:gzip. (see PerlIO::gzip or PerlIO::via::gzip).
In Section
Seekers of Perl Wisdom