in reply to opening/grepping a gzipped file
Secondly, you can save a process invocation by doing the grep inline.
my $file = "/usr/local/apache/logs/access.log.1.gz"; open(PIPE, "gunzip -dc $file |") or die "gunzip $file: $!"; while ( <PIPE> ) { next if ! m|dd/Mon/yyyy|; # massive whatever } close(PIPE);
|
|---|