#!/perl/bin/perl -w use strict; use warnings; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use File::Find; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); $|=1; my $dir; my $zip ; my $zipped; print header(); #=comment # Read a Zip file my $somezip = Archive::Zip->new(); unless ( $somezip->read( 'c:/dir_test/cgi-bin/test/error.zip' ) == AZ_OK ) { die 'read error'; } # Change the compression type for a file in the Zip my $member = $somezip->memberNamed( 'unzipped.txt' ); $member->desiredCompressionMethod(COMPRESSION_DEFLATED); unless ( $zip->writeToFileNamed( 'some.zip' ) == AZ_OK ) { die 'write error'; }