Skip to content

Instantly share code, notes, and snippets.

@ankurs
Created June 19, 2009 10:34
Show Gist options
  • Save ankurs/132549 to your computer and use it in GitHub Desktop.
Save ankurs/132549 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
## use this for any help --> http://search.cpan.org/~adamk/Archive-Zip-1.28/lib/Archive/Zip.pm
use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); # we are using the Archive::Zip module, if its not there download it using ppm
my $zipfile = "abc.zip"; # name of the zip file
my @files = qw( a b c ); # list of files to be zipped
my $zip = Archive::Zip->new(); # just creating the object
foreach (@files)
{
$zip->addFile($_); # adding individual files from @files
}
$zip->writeToFileNamed($zipfile); # writing $filename to the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment