use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $zip = Archive::Zip->new();
unless ( $zip->writeToFileNamed("someZip1.zip") == AZ_OK ) {
die "write error: $!";
}
####
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $zip = Archive::Zip->new();
my $file_member = $zip->addFile( "perl150.pl" );
unless ( $zip->writeToFileNamed("someZip2.zip") == AZ_OK ) {
die "write error: $!";
}
####
$ ls -l someZip*
-rw-r--r-- 1 gmargo gmargo 22 Oct 28 10:39 someZip1.zip
-rw-r--r-- 1 gmargo gmargo 335 Oct 28 10:34 someZip2.zip
$ unzip -v someZip1.zip
Archive: someZip1.zip
warning [someZip1.zip]: zipfile is empty
$ unzip -v someZip2.zip
Archive: someZip2.zip
Length Method Size Ratio Date Time CRC-32 Name
-------- ------ ------- ----- ---- ---- ------ ----
282 Defl:N 217 23% 10-28-09 10:34 ade4be0c perl150.pl
-------- ------- --- -------
282 217 23% 1 file