in reply to dynamic zcat and grep
In other words, this creates an i/o layer that handles the compression for you, on input, output or both, and you just handle the data as if compression were not a factor.use PerlIO::gzip; open( ICMP, "<:gzip", "sometext.gz" ); open( OCMP, ">:gzip", "chosenlines.gz" ); while (<ICMP>) { print OCMP if /something matches/; } close OCMP;
I can't wait for this to be part of the core distro.
(update: corrected the spelling on the cpan link)
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: dynamic zcat and grep
by clmcshque (Initiate) on Mar 28, 2006 at 18:36 UTC | |
by graff (Chancellor) on Mar 29, 2006 at 03:43 UTC |