http://qs321.pair.com?node_id=254878

stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:

Hello all, I've been wondering lately if there is a zip algorithm for perl? I think it would be really neat to write a script that could zip and unzip archives. You could do a lot with it, so much I won't go into detail. Also, as a side note, does any one know about THE zip algorithm used for creating zip programs?
Thanks alot,
Dhoss

Replies are listed 'Best First'.
Re: ZIP algorithm for perl?
by Improv (Pilgrim) on May 02, 2003 at 02:11 UTC
Re: ZIP algorithm for perl?
by pfaut (Priest) on May 02, 2003 at 02:12 UTC
      Thanks guys, I'll take a look at it.
Re: ZIP algorithm for perl?
by crenz (Priest) on May 02, 2003 at 08:23 UTC

    If beyond using Archive::Zip, you are interested in the basics of the algorithm for curiosity's sake, take a look at the the zlib homepage. zlib essentially uses the same algorithm, and they have links to describe how it came about.

      Actually, Archive::Zip uses the compression from Compress::Zlib, which uses a compiled DLL (or equivalent) incorporating the code from the zlib project.

      It's noteworthy that one of the people behind this project, is Mark Adler, the man who originally created the zip algorithm for PKZIP, the (original) ZIP utility for DOS. The other one is Jean-loup Gailly, the author/maintainer of gzip. Therefore it's not surprising that zlib (and thus Compress::Zlib) can handle both gz and zip compression.

      For the algorithm, there's indeed no better place to start than the zlib homepage. You will have to delve into the C code, as the code itself and its comments, are the actual main documentation.

Re: ZIP algorithm for perl?
by #include (Curate) on May 03, 2003 at 07:05 UTC
      Well thank you everyone. It's a great curiousity I've had for a time now, and I appreciate all the feedback. -Dhoss