One of my developers is looking for a way to take records output from 
a database and compress them into a gzip file on the fly, without 
using a file on disk.

To do this, he's using Compress::Zlib and passing \*STDOUT as the 
output file.  Since this is mod_perl, STDOUT is blessed to Apache, 
and appears to be missing Apache::TELL.

# $fh is \*STDOUT
my $gz = gzopen($fh, 'wb');

$gz->gzwrite($line);  # $line is from db.

He's also played with deflating the content on his own, but is unable 
to get the checksum correct on the output.

Has anyone ever compressed something like this on the fly with 
Compress::Zlib.  As I understand it, Apache::Compress creates 
seperate files, which is not acceptable in this case.

Thanks,

Robert Landrum

--
As soon as you make something foolproof, someone will create a better fool.

Reply via email to