Mariano Cunietti <[EMAIL PROTECTED]> asked:
> can anyone address me to a Perl module/function to parse 
> gzipped log files without uncompressing them via gzip/gunzip?

You have to uncompress them somehow, but you don't have to
uncompress them to a file. I regularly use code like this:

  if( $file =~ m/\.gz$/ ){
    $file = "gzip -d < $file |";
  } elsif( $file =~ m/\.bz2$/ ){
    $file = "bzip2 -d < $file |";
  }

  if( my $fh = new IO::File $file ){

    # do something

  } else {
    die "Failed to open input file '$file': $!";
  }

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to