in reply to Searching a gzip file
How would your approach work with a normal file?
If you show us the code you have already, then we can likely help you much better on how to approach moving from a normal file to a compressed file. Have you considered just decompressing your compressed file?
Personally, I'm fond of just using the pipe-open like this:
my $file = 'some_file.gz'; open my $fh, "gzip -cd $file |" or die "Couldn't read/decompress '$file': $!"; while (<$fh>) { ... };
This approach also lends itself well to using the flip-flop operator .., see perlop.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Searching a gzip file
by baski (Novice) on Aug 26, 2010 at 08:16 UTC | |
by Corion (Patriarch) on Aug 26, 2010 at 08:27 UTC |