PerlIO::gzip may be of use.
There are also several other relevant modules you might want to take a look at.
Update: Here are a couple related nodes as well:
Hope that helps.
| [reply] |
If this is a perl question, you might wanna look at using the module Compress::Zlib, which is available from CPAN.
If it isn't a perl question, start by typing gzip -h on the command line of your server. :)
You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue. | [reply] [d/l] |
You can try using Compress::Zlib (alt.), but that may require installing a private version if it isn't already available.
Alternately, you can call the Unix command line utilities gzip -cd or gzcat from Perl using system, exec, backticks or the very groovy Shell module...
use Shell qw/ gzcat /;
my $file = "/path/to/gzipped-file"
my $contents = gzcat( $file );
--k.
| [reply] [d/l] |
If you got access to gunzip on the server you could do something like my $file = 'foo.bar'; #PLEASE Taint Check this if it comes from outsid
+e
my $contents = `gunzip -c $file`;
Otherwise if it's available Compress::Zlib you could take a look at the gzopen function.
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g
| [reply] [d/l] |
Or you just simply use:
die "Can't open $inputFilename for reading, exiting ..." unless open(READGZIPPEDFILE, "zcat $inputFilename|" );
I think it's very efficient like this, taking input zcat pipe.
| [reply] [d/l] |