How to create zip files withou using Archive::zip?

Hi techies,

I have an array of filenames, I want to create a zip file without using Archive::zip module.
Can anybody help me with code?
It is very urgent...

Thanks in advance,
Who is Participating?
TintinConnect With a Mentor Commented:
Archive::Zip is a standard module that comes with ActiveState Perl (5.8.x at least)
If you don't want to use Archive::Zip, does that mean that you also don't want to use Compress::Zlib or the binary Zlib or the binary executable 'zip' program? If we understood better the particular reason you want to do this with one or both hands tied behind your back, we might be able to give you a satisfactory answer.
Assuming you have zip on the system, you can do:

system "zip", "", @arrayoffilenames and die "Can not run zip $!\n";
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

lakshmi_nAuthor Commented:

I dont want to use any non-standard modules that does not come along with Active Perl

lakshmi_nAuthor Commented:
Using Compress:Zlib, how do I compress the files to .zip?
You don't. Zlib is a different compression algorithm.
I suggest you use Archive::Tar (which comes with ActivePerl), and use the 'compressed' option to make a tar.gz file (which Winzip can open).

Something like this:

use Archive::Tar;

$tar = new Archive::Tar;
$tar->add_files( your files here );
$tar->write( 'yourfile.tar.gz', 1 );
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.