In version 1.30, $zip->writeToFileHandle( \*STDOUT, 0) is not working anymore.
In version 1.26 this was working ok.
The code I use looks similar to this:
my $zip = Archive::Zip->new();
my $member = $zip->addFile( '/home/testimg/test1.jpg', 'testfile1.jpg' );
if ($member){
$member->desiredCompressionLevel( 1 );
}
$member = $zip->addFile( '/home/testimg/test2.ppt', 'testfile2.ppt' );
if ($member){
$member->desiredCompressionLevel( 4 );
}
if ( $zip->numberOfMembers() ){
unless ( $zip->writeToFileHandle( \*STDOUT, 0) == Archive::Zip::AZ_OK) {
print STDERR "Zip error: $!";
}
}
This works fine with Archive::Zip version 1.26 but fails with version 1.30
The error is: 'IO error: seeking to rewrite local header : Invalid argument'
If I use desiredCompressionLevel(0) then there is no problem but no
compression is done.
The error is only related to Mod_perl. As a console script it runs fine.
Problem is on both Windows and Linux (perl 5.10).