Question:
How to zip and unzip in perl coding? Anybody help me..?
SAKTHI
2008-09-12 08:51:15 UTC
In Perl
Four answers:
Cloud
2008-09-16 07:46:17 UTC
Here are 2 sample perl scripts :

createZip.pl

extractZip.pl



You can download from

http://w14.easy-share.com/f/1325952222.html
Corbet
2015-08-10 07:48:06 UTC
This Site Might Help You.



RE:

How to zip and unzip in perl coding? Anybody help me..?

In Perl
Zilk
2008-09-12 17:37:09 UTC
As with almost everything else, there is a Perl module on CPAN that does exactly that: Archive::Zip

--> http://search.cpan.org/~adamk/Archive-Zip-1.24/lib/Archive/Zip.pm



If you don't want to (or can't) install new modules, then it depends on which platform you're on. On Linux, you usually have "zip" and "unzip" executables in your path. In that case, you could just call them using system(), for example:



system("unzip -d directory thezipfile.zip");



On Windows... I'm not sure. There may or may not be zip/unzip commands; or you may have to use third party software like WinZip or (better) 7zip.



Hope that helped.
Leo
2008-09-12 08:58:19 UTC
if linux box

system("tar cvf xxx")

system("tar xvf xxx")


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...