in reply to Problems using gzip in a Perl program

Why don't you use the tar -z flag to let tar worry about how to compress this data and do the whole thing a lot less code? Is it not that kind of tar?
my $filename = "$ARCHIVE_PREFIX$dateString.tar.gz"; $status = system( "/usr/bin/tar czf $filename $tempDir" );