Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm needing to process a large number of huge gzip'ped log files. I have working code which does the obvious decompression/compression:
I have a lot of files to process. How can I use zcat to make this run faster? Reading the entire log file into a scalar with slurp mode is prohibitive given the file size.# ... system('gunzip', "$filename.gz"); open(IN, $filename) or die "unable to open '$filename'"; while (<IN>) { # process each line } close IN; system('gzip', $filename); # ...
Any idea would be appreciated. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using zcat for input?
by Zaxo (Archbishop) on Nov 01, 2004 at 00:28 UTC | |
by Schuk (Pilgrim) on Dec 10, 2004 at 13:07 UTC | |
|
Re: using zcat for input?
by atcroft (Abbot) on Nov 01, 2004 at 00:22 UTC | |
by thor (Priest) on Nov 01, 2004 at 02:55 UTC | |
by Anonymous Monk on Feb 28, 2017 at 16:03 UTC |